src/HOL/Complex/CLim.ML
author paulson
Tue, 23 Dec 2003 16:53:33 +0100
changeset 14323 27724f528f82
parent 14320 fb7a114826be
child 14331 8dbbb7cf3637
permissions -rw-r--r--
converting Complex/Complex.ML to Isar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     1
(*  Title       : CLim.ML
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     3
    Copyright   : 2001 University of Edinburgh
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     4
    Description : A first theory of limits, continuity and 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     5
                  differentiation for complex functions
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     6
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     7
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     8
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     9
(* Limit of complex to complex function                                               *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    10
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    11
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    12
Goalw [NSCLIM_def,NSCRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    13
   "f -- a --NSC> L ==> (%x. Re(f x)) -- a --NSCR> Re(L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    14
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    15
by (auto_tac (claset(),simpset() addsimps [starfunC_approx_Re_Im_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    16
    hRe_hcomplex_of_complex]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    17
qed "NSCLIM_NSCRLIM_Re";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    18
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    19
Goalw [NSCLIM_def,NSCRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    20
   "f -- a --NSC> L ==> (%x. Im(f x)) -- a --NSCR> Im(L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    21
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    22
by (auto_tac (claset(),simpset() addsimps [starfunC_approx_Re_Im_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    23
    hIm_hcomplex_of_complex]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    24
qed "NSCLIM_NSCRLIM_Im";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    25
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    26
Goalw [CLIM_def,NSCLIM_def,capprox_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    27
      "f -- x --C> L ==> f -- x --NSC> L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    28
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    29
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    30
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    31
    starfunC,hcomplex_diff,CInfinitesimal_hcmod_iff,hcmod,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    32
    Infinitesimal_FreeUltrafilterNat_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    33
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    34
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    35
by (dres_inst_tac [("x","u")] spec 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    36
by (dres_inst_tac [("x","s")] spec 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    37
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    38
by (dtac sym 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    39
qed "CLIM_NSCLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    40
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    41
Goal "(ALL t. P t) = (ALL X. P (Abs_hcomplex(hcomplexrel `` {X})))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    42
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    43
by (res_inst_tac [("z","t")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    44
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    45
qed "eq_Abs_hcomplex_ALL";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    46
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    47
Goal "ALL s. 0 < s --> (EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    48
\        cmod (xa - x) < s  & r <= cmod (f xa - L)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    49
\     ==> ALL (n::nat). EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    50
\             cmod(xa - x) < inverse(real(Suc n)) & r <= cmod(f xa - L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    51
by (Clarify_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    52
by (cut_inst_tac [("n1","n")]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    53
    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    54
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    55
val lemma_CLIM = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    56
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    57
(* not needed? *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    58
Goal "ALL x z. EX y. Q x z y ==> EX f. ALL x z. Q x z (f x z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    59
by (rtac choice 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    60
by (blast_tac (claset() addIs [choice]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    61
qed "choice2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    62
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    63
Goal "ALL s. 0 < s --> (EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    64
\        cmod (xa - x) < s  & r <= cmod (f xa - L)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    65
\     ==> EX X. ALL (n::nat). X n ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    66
\               cmod(X n - x) < inverse(real(Suc n)) & r <= cmod(f (X n) - L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    67
by (dtac lemma_CLIM 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    68
by (dtac choice 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    69
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    70
val lemma_skolemize_CLIM2 = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    71
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    72
Goal "ALL n. X n ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    73
\         cmod (X n - x) < inverse (real(Suc n)) & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    74
\         r <= cmod (f (X n) - L) ==> \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    75
\         ALL n. cmod (X n - x) < inverse (real(Suc n))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    76
by (Auto_tac );
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    77
val lemma_csimp = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    78
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    79
Goalw [CLIM_def,NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    80
     "f -- x --NSC> L ==> f -- x --C> L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    81
by (auto_tac (claset(),simpset() addsimps [eq_Abs_hcomplex_ALL,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    82
    starfunC,CInfinitesimal_capprox_minus RS sym,hcomplex_diff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    83
    CInfinitesimal_hcmod_iff,hcomplex_of_complex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    84
    Infinitesimal_FreeUltrafilterNat_iff,hcmod]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    85
by (EVERY1[rtac ccontr, Asm_full_simp_tac]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    86
by (fold_tac [real_le_def]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    87
by (dtac lemma_skolemize_CLIM2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    88
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    89
by (dres_inst_tac [("x","X")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    90
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    91
by (dtac (lemma_csimp RS complex_seq_to_hcomplex_CInfinitesimal) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    92
by (asm_full_simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    93
    hcomplex_of_complex_def,Infinitesimal_FreeUltrafilterNat_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    94
    hcomplex_diff,hcmod]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    95
by (Blast_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    96
by (dres_inst_tac [("x","r")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    97
by (Clarify_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    98
by (dtac FreeUltrafilterNat_all 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    99
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   100
by (arith_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   101
qed "NSCLIM_CLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   102
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   103
(**** First key result ****)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   104
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   105
Goal "(f -- x --C> L) = (f -- x --NSC> L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   106
by (blast_tac (claset() addIs [CLIM_NSCLIM,NSCLIM_CLIM]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   107
qed "CLIM_NSCLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   108
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   109
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   110
(* Limit of complex to real function                                                  *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   111
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   112
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   113
Goalw [CRLIM_def,NSCRLIM_def,capprox_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   114
      "f -- x --CR> L ==> f -- x --NSCR> L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   115
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   116
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   117
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   118
    starfunCR,hcomplex_diff,CInfinitesimal_hcmod_iff,hcmod,hypreal_diff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   119
    Infinitesimal_FreeUltrafilterNat_iff,Infinitesimal_approx_minus RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   120
    hypreal_of_real_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   121
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   122
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   123
by (dres_inst_tac [("x","u")] spec 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   124
by (dres_inst_tac [("x","s")] spec 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   125
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   126
by (dtac sym 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   127
qed "CRLIM_NSCRLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   128
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   129
Goal "ALL s. 0 < s --> (EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   130
\        cmod (xa - x) < s  & r <= abs (f xa - L)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   131
\     ==> ALL (n::nat). EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   132
\             cmod(xa - x) < inverse(real(Suc n)) & r <= abs (f xa - L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   133
by (Clarify_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   134
by (cut_inst_tac [("n1","n")]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   135
    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   136
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   137
val lemma_CRLIM = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   138
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   139
Goal "ALL s. 0 < s --> (EX xa.  xa ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   140
\        cmod (xa - x) < s  & r <= abs (f xa - L)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   141
\     ==> EX X. ALL (n::nat). X n ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   142
\               cmod(X n - x) < inverse(real(Suc n)) & r <= abs (f (X n) - L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   143
by (dtac lemma_CRLIM 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   144
by (dtac choice 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   145
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   146
val lemma_skolemize_CRLIM2 = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   147
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   148
Goal "ALL n. X n ~= x & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   149
\         cmod (X n - x) < inverse (real(Suc n)) & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   150
\         r <= abs (f (X n) - L) ==> \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   151
\         ALL n. cmod (X n - x) < inverse (real(Suc n))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   152
by (Auto_tac );
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   153
val lemma_crsimp = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   154
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   155
Goalw [CRLIM_def,NSCRLIM_def,capprox_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   156
      "f -- x --NSCR> L ==> f -- x --CR> L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   157
by (auto_tac (claset(),simpset() addsimps [eq_Abs_hcomplex_ALL,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   158
    starfunCR,hcomplex_diff,hcomplex_of_complex_def,hypreal_diff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   159
    CInfinitesimal_hcmod_iff,hcmod,Infinitesimal_approx_minus RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   160
    Infinitesimal_FreeUltrafilterNat_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   161
by (EVERY1[rtac ccontr, Asm_full_simp_tac]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   162
by (fold_tac [real_le_def]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   163
by (dtac lemma_skolemize_CRLIM2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   164
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   165
by (dres_inst_tac [("x","X")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   166
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   167
by (dtac (lemma_crsimp RS complex_seq_to_hcomplex_CInfinitesimal) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   168
by (asm_full_simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   169
    hcomplex_of_complex_def,Infinitesimal_FreeUltrafilterNat_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   170
    hcomplex_diff,hcmod]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   171
by (Blast_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   172
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   173
    hypreal_diff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   174
by (dres_inst_tac [("x","r")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   175
by (Clarify_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   176
by (dtac FreeUltrafilterNat_all 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   177
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   178
qed "NSCRLIM_CRLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   179
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   180
(** second key result **)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   181
Goal "(f -- x --CR> L) = (f -- x --NSCR> L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   182
by (blast_tac (claset() addIs [CRLIM_NSCRLIM,NSCRLIM_CRLIM]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   183
qed "CRLIM_NSCRLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   184
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   185
(** get this result easily now **)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   186
Goal "f -- a --C> L ==> (%x. Re(f x)) -- a --CR> Re(L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   187
by (auto_tac (claset() addDs [NSCLIM_NSCRLIM_Re],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   188
    addsimps [CLIM_NSCLIM_iff,CRLIM_NSCRLIM_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   189
qed "CLIM_CRLIM_Re";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   190
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   191
Goal "f -- a --C> L ==> (%x. Im(f x)) -- a --CR> Im(L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   192
by (auto_tac (claset() addDs [NSCLIM_NSCRLIM_Im],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   193
    addsimps [CLIM_NSCLIM_iff,CRLIM_NSCRLIM_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   194
qed "CLIM_CRLIM_Im";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   195
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   196
Goal "f -- a --C> L ==> (%x. cnj (f x)) -- a --C> cnj L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   197
by (auto_tac (claset(),simpset() addsimps [CLIM_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   198
    complex_cnj_diff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   199
qed "CLIM_cnj";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   200
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   201
Goal "((%x. cnj (f x)) -- a --C> cnj L) = (f -- a --C> L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   202
by (auto_tac (claset(),simpset() addsimps [CLIM_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   203
    complex_cnj_diff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   204
qed "CLIM_cnj_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   205
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   206
(*** NSLIM_add hence CLIM_add *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   207
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   208
Goalw [NSCLIM_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   209
     "[| f -- x --NSC> l; g -- x --NSC> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   210
\     ==> (%x. f(x) + g(x)) -- x --NSC> (l + m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   211
by (auto_tac (claset() addSIs [capprox_add], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   212
qed "NSCLIM_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   213
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   214
Goal "[| f -- x --C> l; g -- x --C> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   215
\     ==> (%x. f(x) + g(x)) -- x --C> (l + m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   216
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_add]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   217
qed "CLIM_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   218
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   219
(*** NSLIM_mult hence CLIM_mult *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   220
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   221
Goalw [NSCLIM_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   222
     "[| f -- x --NSC> l; g -- x --NSC> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   223
\     ==> (%x. f(x) * g(x)) -- x --NSC> (l * m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   224
by (auto_tac (claset() addSIs [capprox_mult_CFinite],  simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   225
qed "NSCLIM_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   226
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   227
Goal "[| f -- x --C> l; g -- x --C> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   228
\     ==> (%x. f(x) * g(x)) -- x --C> (l * m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   229
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_mult]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   230
qed "CLIM_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   231
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   232
(*** NSCLIM_const and CLIM_const ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   233
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   234
Goalw [NSCLIM_def] "(%x. k) -- x --NSC> k";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   235
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   236
qed "NSCLIM_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   237
Addsimps [NSCLIM_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   238
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   239
Goalw [CLIM_def] "(%x. k) -- x --C> k";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   240
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   241
qed "CLIM_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   242
Addsimps [CLIM_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   243
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   244
(*** NSCLIM_minus and CLIM_minus ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   245
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   246
Goalw [NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   247
      "f -- a --NSC> L ==> (%x. -f(x)) -- a --NSC> -L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   248
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   249
qed "NSCLIM_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   250
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   251
Goal "f -- a --C> L ==> (%x. -f(x)) -- a --C> -L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   252
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   253
qed "CLIM_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   254
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   255
(*** NSCLIM_diff hence CLIM_diff ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   256
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   257
Goalw [complex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   258
     "[| f -- x --NSC> l; g -- x --NSC> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   259
\     ==> (%x. f(x) - g(x)) -- x --NSC> (l - m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   260
by (auto_tac (claset(), simpset() addsimps [NSCLIM_add,NSCLIM_minus]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   261
qed "NSCLIM_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   262
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   263
Goal "[| f -- x --C> l; g -- x --C> m |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   264
\     ==> (%x. f(x) - g(x)) -- x --C> (l - m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   265
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_diff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   266
qed "CLIM_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   267
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   268
(*** NSCLIM_inverse and hence CLIM_inverse *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   269
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   270
Goalw [NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   271
     "[| f -- a --NSC> L;  L ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   272
\     ==> (%x. inverse(f(x))) -- a --NSC> (inverse L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   273
by (Clarify_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   274
by (dtac spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   275
by (auto_tac (claset(), 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   276
              simpset() addsimps [hcomplex_of_complex_capprox_inverse]));  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   277
qed "NSCLIM_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   278
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   279
Goal "[| f -- a --C> L;  L ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   280
\     ==> (%x. inverse(f(x))) -- a --C> (inverse L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   281
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_inverse]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   282
qed "CLIM_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   283
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   284
(*** NSCLIM_zero, CLIM_zero, etc. ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   285
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   286
Goal "f -- a --NSC> l ==> (%x. f(x) - l) -- a --NSC> 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   287
by (res_inst_tac [("z1","l")] (complex_add_minus_right_zero RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   288
by (rewtac complex_diff_def);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   289
by (rtac NSCLIM_add 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   290
qed "NSCLIM_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   291
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   292
Goal "f -- a --C> l ==> (%x. f(x) - l) -- a --C> 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   293
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_zero]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   294
qed "CLIM_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   295
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   296
Goal "(%x. f(x) - l) -- x --NSC> 0 ==> f -- x --NSC> l";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   297
by (dres_inst_tac [("g","%x. l"),("m","l")] NSCLIM_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   298
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   299
qed "NSCLIM_zero_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   300
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   301
Goal "(%x. f(x) - l) -- x --C> 0 ==> f -- x --C> l";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   302
by (dres_inst_tac [("g","%x. l"),("m","l")] CLIM_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   303
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   304
qed "CLIM_zero_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   305
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   306
(*** NSCLIM_not zero and hence CLIM_not_zero ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   307
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   308
(*not in simpset?*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   309
Addsimps [hypreal_epsilon_not_zero];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   310
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   311
Goalw [NSCLIM_def] "k ~= 0 ==> ~ ((%x. k) -- x --NSC> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   312
by (auto_tac (claset(),simpset() delsimps [hcomplex_of_complex_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   313
by (res_inst_tac [("x","hcomplex_of_complex x + hcomplex_of_hypreal epsilon")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   314
by (auto_tac (claset() addIs [CInfinitesimal_add_capprox_self RS capprox_sym],simpset()
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   315
    delsimps [hcomplex_of_complex_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   316
qed "NSCLIM_not_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   317
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   318
(* [| k ~= 0; (%x. k) -- x --NSC> 0 |] ==> R *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   319
bind_thm("NSCLIM_not_zeroE", NSCLIM_not_zero RS notE);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   320
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   321
Goal "k ~= 0 ==> ~ ((%x. k) -- x --C> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   322
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_not_zero]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   323
qed "CLIM_not_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   324
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   325
(*** NSCLIM_const hence CLIM_const ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   326
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   327
Goal "(%x. k) -- x --NSC> L ==> k = L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   328
by (rtac ccontr 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   329
by (dtac NSCLIM_zero 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   330
by (rtac NSCLIM_not_zeroE 1 THEN assume_tac 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   331
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   332
qed "NSCLIM_const_eq";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   333
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   334
Goal "(%x. k) -- x --C> L ==> k = L";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   335
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff,NSCLIM_const_eq]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   336
qed "CLIM_const_eq";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   337
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   338
(*** NSCLIM and hence CLIM are unique ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   339
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   340
Goal "[| f -- x --NSC> L; f -- x --NSC> M |] ==> L = M";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   341
by (dtac NSCLIM_minus 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   342
by (dtac NSCLIM_add 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   343
by (auto_tac (claset() addSDs [NSCLIM_const_eq RS sym], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   344
qed "NSCLIM_unique";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   345
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   346
Goal "[| f -- x --C> L; f -- x --C> M |] ==> L = M";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   347
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_unique]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   348
qed "CLIM_unique";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   349
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   350
(***  NSCLIM_mult_zero and CLIM_mult_zero ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   351
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   352
Goal "[| f -- x --NSC> 0; g -- x --NSC> 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   353
\         ==> (%x. f(x)*g(x)) -- x --NSC> 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   354
by (dtac NSCLIM_mult 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   355
qed "NSCLIM_mult_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   356
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   357
Goal "[| f -- x --C> 0; g -- x --C> 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   358
\     ==> (%x. f(x)*g(x)) -- x --C> 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   359
by (dtac CLIM_mult 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   360
qed "CLIM_mult_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   361
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   362
(*** NSCLIM_self hence CLIM_self ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   363
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   364
Goalw [NSCLIM_def] "(%x. x) -- a --NSC> a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   365
by (auto_tac (claset() addIs [starfunC_Idfun_capprox],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   366
qed "NSCLIM_self";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   367
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   368
Goal "(%x. x) -- a --C> a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   369
by (simp_tac (simpset() addsimps [CLIM_NSCLIM_iff,NSCLIM_self]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   370
qed "CLIM_self";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   371
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   372
(** another equivalence result **)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   373
Goalw [NSCLIM_def,NSCRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   374
   "(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   375
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_capprox_minus 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   376
    RS sym,CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   377
by (ALLGOALS(dtac spec) THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   378
by (ALLGOALS(res_inst_tac [("z","xa")] eq_Abs_hcomplex));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   379
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   380
    starfunC,starfunCR,hcomplex_of_complex_def,hcmod,mem_infmal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   381
qed "NSCLIM_NSCRLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   382
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   383
(** much, much easier standard proof **)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   384
Goalw [CLIM_def,CRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   385
   "(f -- x --C> L) = ((%y. cmod(f y - L)) -- x --CR> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   386
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   387
qed "CLIM_CRLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   388
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   389
(* so this is nicer nonstandard proof *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   390
Goal "(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   391
by (auto_tac (claset(),simpset() addsimps [CRLIM_NSCRLIM_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   392
    CLIM_CRLIM_iff,CLIM_NSCLIM_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   393
qed "NSCLIM_NSCRLIM_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   394
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   395
Goal "(f -- a --NSC> L) = ((%x. Re(f x)) -- a --NSCR> Re(L) & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   396
\                           (%x. Im(f x)) -- a --NSCR> Im(L))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   397
by (auto_tac (claset() addIs [NSCLIM_NSCRLIM_Re,NSCLIM_NSCRLIM_Im],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   398
by (auto_tac (claset(),simpset() addsimps [NSCLIM_def,NSCRLIM_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   399
by (REPEAT(dtac spec 1) THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   400
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   401
by (auto_tac (claset(),simpset() addsimps [capprox_approx_iff,starfunC,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   402
    hcomplex_of_complex_def,starfunCR,hypreal_of_real_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   403
qed "NSCLIM_NSCRLIM_Re_Im_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   404
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   405
Goal "(f -- a --C> L) = ((%x. Re(f x)) -- a --CR> Re(L) & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   406
\                        (%x. Im(f x)) -- a --CR> Im(L))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   407
by (auto_tac (claset(),simpset() addsimps [CLIM_NSCLIM_iff,CRLIM_NSCRLIM_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   408
    NSCLIM_NSCRLIM_Re_Im_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   409
qed "CLIM_CRLIM_Re_Im_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   410
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   411
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   412
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   413
(* Continuity                                                                         *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   414
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   415
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   416
Goalw [isNSContc_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   417
      "[| isNSContc f a; y @c= hcomplex_of_complex a |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   418
\           ==> ( *fc* f) y @c= hcomplex_of_complex (f a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   419
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   420
qed "isNSContcD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   421
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   422
Goalw [isNSContc_def,NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   423
      "isNSContc f a ==> f -- a --NSC> (f a) ";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   424
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   425
qed "isNSContc_NSCLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   426
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   427
Goalw [isNSContc_def,NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   428
      "f -- a --NSC> (f a) ==> isNSContc f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   429
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   430
by (res_inst_tac [("Q","y = hcomplex_of_complex a")] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   431
    (excluded_middle RS disjE) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   432
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   433
qed "NSCLIM_isNSContc";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   434
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   435
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   436
(* NS continuity can be defined using NS Limit in   *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   437
(* similar fashion to standard def of continuity    *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   438
(* -------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   439
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   440
Goal "(isNSContc f a) = (f -- a --NSC> (f a))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   441
by (blast_tac (claset() addIs [isNSContc_NSCLIM,NSCLIM_isNSContc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   442
qed "isNSContc_NSCLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   443
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   444
Goal "(isNSContc f a) = (f -- a --C> (f a))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   445
by (asm_full_simp_tac (simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   446
    [CLIM_NSCLIM_iff,isNSContc_NSCLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   447
qed "isNSContc_CLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   448
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   449
(*** key result for continuity ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   450
Goalw [isContc_def] "(isNSContc f a) = (isContc f a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   451
by (rtac isNSContc_CLIM_iff 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   452
qed "isNSContc_isContc_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   453
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   454
Goal "isContc f a ==> isNSContc f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   455
by (etac (isNSContc_isContc_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   456
qed "isContc_isNSContc";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   457
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   458
Goal "isNSContc f a ==> isContc f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   459
by (etac (isNSContc_isContc_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   460
qed "isNSContc_isContc";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   461
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   462
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   463
(* Alternative definition of continuity             *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   464
(* -------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   465
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   466
Goalw [NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   467
     "(f -- a --NSC> L) = ((%h. f(a + h)) -- 0 --NSC> L)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   468
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   469
by (dres_inst_tac [("x","hcomplex_of_complex a + x")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   470
by (dres_inst_tac [("x","- hcomplex_of_complex a + x")] spec 2);
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
   471
by Safe_tac;
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   472
by (Asm_full_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   473
by (rtac ((mem_cinfmal_iff RS iffD2) RS 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   474
    (CInfinitesimal_add_capprox_self RS capprox_sym)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   475
by (rtac (capprox_minus_iff2 RS iffD1) 4);
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
   476
by (asm_full_simp_tac (simpset() addsimps compare_rls@[hcomplex_add_commute]) 3);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   477
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   478
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 4);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   479
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   480
       simpset() addsimps [starfunC, hcomplex_of_complex_def, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   481
              hcomplex_minus, hcomplex_add]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   482
qed "NSCLIM_h_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   483
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   484
Goal "(f -- a --NSC> f a) = ((%h. f(a + h)) -- 0 --NSC> f a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   485
by (rtac NSCLIM_h_iff 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   486
qed "NSCLIM_isContc_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   487
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   488
Goal "(f -- a --C> f a) = ((%h. f(a + h)) -- 0 --C> f(a))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   489
by (simp_tac (simpset() addsimps [CLIM_NSCLIM_iff, NSCLIM_isContc_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   490
qed "CLIM_isContc_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   491
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   492
Goalw [isContc_def] "(isContc f x) = ((%h. f(x + h)) -- 0 --C> f(x))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   493
by (simp_tac (simpset() addsimps [CLIM_isContc_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   494
qed "isContc_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   495
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   496
Goal "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) + g(x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   497
by (auto_tac (claset() addIs [capprox_add],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   498
              simpset() addsimps [isNSContc_isContc_iff RS sym, isNSContc_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   499
qed "isContc_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   500
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   501
Goal "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) * g(x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   502
by (auto_tac (claset() addSIs [starfunC_mult_CFinite_capprox],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   503
              simpset() delsimps [starfunC_mult RS sym]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   504
			addsimps [isNSContc_isContc_iff RS sym, isNSContc_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   505
qed "isContc_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   506
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   507
(*** more theorems: note simple proofs ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   508
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   509
Goal "[| isContc f a; isContc g (f a) |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   510
\     ==> isContc (g o f) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   511
by (auto_tac (claset(),simpset() addsimps [isNSContc_isContc_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   512
              isNSContc_def,starfunC_o RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   513
qed "isContc_o";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   514
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   515
Goal "[| isContc f a; isContc g (f a) |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   516
\     ==> isContc (%x. g (f x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   517
by (auto_tac (claset() addDs [isContc_o],simpset() addsimps [o_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   518
qed "isContc_o2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   519
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   520
Goalw [isNSContc_def] "isNSContc f a ==> isNSContc (%x. - f x) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   521
by Auto_tac; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   522
qed "isNSContc_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   523
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   524
Goal "isContc f a ==> isContc (%x. - f x) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   525
by (auto_tac (claset(),simpset() addsimps [isNSContc_isContc_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   526
              isNSContc_minus]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   527
qed "isContc_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   528
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   529
Goalw [isContc_def]  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   530
      "[| isContc f x; f x ~= 0 |] ==> isContc (%x. inverse (f x)) x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   531
by (blast_tac (claset() addIs [CLIM_inverse]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   532
qed "isContc_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   533
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   534
Goal "[| isNSContc f x; f x ~= 0 |] ==> isNSContc (%x. inverse (f x)) x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   535
by (auto_tac (claset() addIs [isContc_inverse],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   536
    [isNSContc_isContc_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   537
qed "isNSContc_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   538
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   539
Goalw [complex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   540
      "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) - g(x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   541
by (auto_tac (claset() addIs [isContc_add,isContc_minus],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   542
qed "isContc_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   543
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   544
Goalw [isContc_def]  "isContc (%x. k) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   545
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   546
qed "isContc_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   547
Addsimps [isContc_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   548
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   549
Goalw [isNSContc_def]  "isNSContc (%x. k) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   550
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   551
qed "isNSContc_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   552
Addsimps [isNSContc_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   553
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   554
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   555
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   556
(* functions from complex to reals                                                    *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   557
(* -----------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   558
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   559
Goalw [isNSContCR_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   560
      "[| isNSContCR f a; y @c= hcomplex_of_complex a |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   561
\           ==> ( *fcR* f) y @= hypreal_of_real (f a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   562
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   563
qed "isNSContCRD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   564
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   565
Goalw [isNSContCR_def,NSCRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   566
      "isNSContCR f a ==> f -- a --NSCR> (f a) ";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   567
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   568
qed "isNSContCR_NSCRLIM";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   569
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   570
Goalw [isNSContCR_def,NSCRLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   571
      "f -- a --NSCR> (f a) ==> isNSContCR f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   572
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   573
by (res_inst_tac [("Q","y = hcomplex_of_complex a")] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   574
    (excluded_middle RS disjE) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   575
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   576
qed "NSCRLIM_isNSContCR";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   577
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   578
Goal "(isNSContCR f a) = (f -- a --NSCR> (f a))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   579
by (blast_tac (claset() addIs [isNSContCR_NSCRLIM,NSCRLIM_isNSContCR]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   580
qed "isNSContCR_NSCRLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   581
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   582
Goal "(isNSContCR f a) = (f -- a --CR> (f a))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   583
by (asm_full_simp_tac (simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   584
    [CRLIM_NSCRLIM_iff,isNSContCR_NSCRLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   585
qed "isNSContCR_CRLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   586
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   587
(*** another key result for continuity ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   588
Goalw [isContCR_def] "(isNSContCR f a) = (isContCR f a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   589
by (rtac isNSContCR_CRLIM_iff 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   590
qed "isNSContCR_isContCR_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   591
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   592
Goal "isContCR f a ==> isNSContCR f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   593
by (etac (isNSContCR_isContCR_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   594
qed "isContCR_isNSContCR";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   595
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   596
Goal "isNSContCR f a ==> isContCR f a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   597
by (etac (isNSContCR_isContCR_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   598
qed "isNSContCR_isContCR";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   599
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   600
Goalw [isNSContCR_def]  "isNSContCR cmod (a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   601
by (auto_tac (claset() addIs [capprox_hcmod_approx],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   602
    simpset() addsimps [starfunCR_cmod,hcmod_hcomplex_of_complex
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   603
    RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   604
qed "isNSContCR_cmod";    
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   605
Addsimps [isNSContCR_cmod];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   606
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   607
Goal "isContCR cmod (a)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   608
by (auto_tac (claset(),simpset() addsimps [isNSContCR_isContCR_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   609
qed "isContCR_cmod";    
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   610
Addsimps [isContCR_cmod];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   611
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   612
Goalw [isContc_def,isContCR_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   613
  "isContc f a ==> isContCR (%x. Re (f x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   614
by (etac CLIM_CRLIM_Re 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   615
qed "isContc_isContCR_Re"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   616
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   617
Goalw [isContc_def,isContCR_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   618
  "isContc f a ==> isContCR (%x. Im (f x)) a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   619
by (etac CLIM_CRLIM_Im 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   620
qed "isContc_isContCR_Im"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   621
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   622
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   623
(* Derivatives                                                                        *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   624
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   625
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   626
Goalw [cderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   627
      "(CDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   628
by (Blast_tac 1);        
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   629
qed "CDERIV_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   630
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   631
Goalw [cderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   632
      "(CDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   633
by (simp_tac (simpset() addsimps [CLIM_NSCLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   634
qed "CDERIV_NSC_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   635
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   636
Goalw [cderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   637
      "CDERIV f x :> D \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   638
\      ==> (%h. (f(x + h) - f(x))/h) -- 0 --C> D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   639
by (Blast_tac 1);        
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   640
qed "CDERIVD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   641
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   642
Goalw [cderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   643
      "CDERIV f x :> D ==> (%h. (f(x + h) - f(x))/h) -- 0 --NSC> D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   644
by (asm_full_simp_tac (simpset() addsimps [CLIM_NSCLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   645
qed "NSC_DERIVD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   646
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   647
(*** Uniqueness ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   648
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   649
Goalw [cderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   650
      "[| CDERIV f x :> D; CDERIV f x :> E |] ==> D = E";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   651
by (blast_tac (claset() addIs [CLIM_unique]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   652
qed "CDERIV_unique";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   653
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   654
(*** uniqueness: a nonstandard proof ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   655
Goalw [nscderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   656
     "[| NSCDERIV f x :> D; NSCDERIV f x :> E |] ==> D = E";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   657
by (auto_tac (claset() addSDs [inst "x" "hcomplex_of_hypreal epsilon" bspec] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   658
                       addSIs [inj_hcomplex_of_complex RS injD] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   659
                       addDs [capprox_trans3],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   660
              simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   661
qed "NSCDeriv_unique";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   662
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   663
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   664
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   665
(* Differentiability                                                                  *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   666
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   667
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   668
Goalw [cdifferentiable_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   669
      "f cdifferentiable x ==> EX D. CDERIV f x :> D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   670
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   671
qed "cdifferentiableD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   672
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   673
Goalw [cdifferentiable_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   674
      "CDERIV f x :> D ==> f cdifferentiable x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   675
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   676
qed "cdifferentiableI";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   677
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   678
Goalw [NSCdifferentiable_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   679
      "f NSCdifferentiable x ==> EX D. NSCDERIV f x :> D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   680
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   681
qed "NSCdifferentiableD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   682
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   683
Goalw [NSCdifferentiable_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   684
      "NSCDERIV f x :> D ==> f NSCdifferentiable x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   685
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   686
qed "NSCdifferentiableI";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   687
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   688
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   689
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   690
(* Alternative definition for differentiability                                       *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   691
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   692
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   693
Goalw [CLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   694
 "((%h. (f(a + h) - f(a))/h) -- 0 --C> D) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   695
\ ((%x. (f(x) - f(a)) / (x - a)) -- a --C> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   696
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   697
by (ALLGOALS(dtac spec));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   698
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   699
by (Blast_tac 1 THEN Blast_tac 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   700
by (ALLGOALS(res_inst_tac [("x","s")] exI));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   701
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   702
by (dres_inst_tac [("x","x - a")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   703
by (dres_inst_tac [("x","x + a")] spec 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   704
by (auto_tac (claset(), simpset() addsimps complex_add_ac));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   705
qed "CDERIV_CLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   706
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   707
Goalw [cderiv_def] "(CDERIV f x :> D) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   708
\         ((%z. (f(z) - f(x)) / (z - x)) -- x --C> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   709
by (simp_tac (simpset() addsimps [CDERIV_CLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   710
qed "CDERIV_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   711
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   712
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   713
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   714
(* Equivalence of NS and standard defs of differentiation                             *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   715
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   716
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   717
(*** first equivalence ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   718
Goalw [nscderiv_def,NSCLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   719
      "(NSCDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   720
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   721
by (dres_inst_tac [("x","xa")] bspec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   722
by (rtac ccontr 3);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   723
by (dres_inst_tac [("x","h")] spec 3);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   724
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   725
              simpset() addsimps [mem_cinfmal_iff, starfunC_lambda_cancel]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   726
qed "NSCDERIV_NSCLIM_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   727
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   728
(*** 2nd equivalence ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   729
Goal "(NSCDERIV f x :> D) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   730
\         ((%z. (f(z) - f(x)) / (z - x)) -- x --NSC> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   731
by (full_simp_tac (simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   732
     [NSCDERIV_NSCLIM_iff, CDERIV_CLIM_iff, CLIM_NSCLIM_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   733
qed "NSCDERIV_NSCLIM_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   734
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   735
Goal "(NSCDERIV f x :> D) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   736
\     (ALL xa. xa ~= hcomplex_of_complex x & xa @c= hcomplex_of_complex x --> \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   737
\       ( *fc* (%z. (f z - f x) / (z - x))) xa @c= hcomplex_of_complex D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   738
by (auto_tac (claset(), simpset() addsimps [NSCDERIV_NSCLIM_iff2, NSCLIM_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   739
qed "NSCDERIV_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   740
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   741
Goalw [cderiv_def] "(NSCDERIV f x :> D) = (CDERIV f x :> D)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   742
by (simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff,CLIM_NSCLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   743
qed "NSCDERIV_CDERIV_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   744
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   745
Goalw [nscderiv_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   746
      "NSCDERIV f x :> D ==> isNSContc f x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   747
by (auto_tac (claset(),simpset() addsimps [isNSContc_NSCLIM_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   748
    NSCLIM_def,hcomplex_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   749
by (dtac (capprox_minus_iff RS iffD1) 1);
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
   750
by (subgoal_tac "xa + - (hcomplex_of_complex x) ~= 0" 1);
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
   751
 by (asm_full_simp_tac (simpset() addsimps compare_rls) 2);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   752
by (dres_inst_tac [("x","- hcomplex_of_complex x + xa")] bspec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   753
by (asm_full_simp_tac (simpset() addsimps [hcomplex_add_assoc RS sym]) 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   754
by (auto_tac (claset(),simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   755
    [mem_cinfmal_iff RS sym,hcomplex_add_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   756
by (dres_inst_tac [("c","xa + - hcomplex_of_complex x")] capprox_mult1 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   757
by (auto_tac (claset() addIs [CInfinitesimal_subset_CFinite
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   758
    RS subsetD],simpset() addsimps [hcomplex_mult_assoc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   759
by (dres_inst_tac [("x3","D")] (CFinite_hcomplex_of_complex RSN
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   760
    (2,CInfinitesimal_CFinite_mult) RS (mem_cinfmal_iff RS iffD1)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   761
by (blast_tac (claset() addIs [capprox_trans,hcomplex_mult_commute RS subst,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   762
    (capprox_minus_iff RS iffD2)]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   763
qed "NSCDERIV_isNSContc";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   764
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   765
Goal "CDERIV f x :> D ==> isContc f x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   766
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff RS sym, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   767
    isNSContc_isContc_iff RS sym,NSCDERIV_isNSContc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   768
qed "CDERIV_isContc";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   769
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   770
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   771
(* Differentiation rules for combinations of functions follow from clear,             *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   772
(* straightforard, algebraic manipulations                                            *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   773
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   774
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   775
(* use simple constant nslimit theorem *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   776
Goal "(NSCDERIV (%x. k) x :> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   777
by (simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   778
qed "NSCDERIV_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   779
Addsimps [NSCDERIV_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   780
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   781
Goal "(CDERIV (%x. k) x :> 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   782
by (simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   783
qed "CDERIV_const";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   784
Addsimps [CDERIV_const];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   785
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   786
Goal "[| NSCDERIV f x :> Da;  NSCDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   787
\     ==> NSCDERIV (%x. f x + g x) x :> Da + Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   788
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   789
           NSCLIM_def]) 1 THEN REPEAT(Step_tac 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   790
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   791
       simpset() addsimps [hcomplex_add_divide_distrib,hcomplex_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   792
by (dres_inst_tac [("b","hcomplex_of_complex Da"),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   793
                   ("d","hcomplex_of_complex Db")] capprox_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   794
by (auto_tac (claset(), simpset() addsimps hcomplex_add_ac));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   795
qed "NSCDERIV_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   796
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   797
Goal "[| CDERIV f x :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   798
\     ==> CDERIV (%x. f x + g x) x :> Da + Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   799
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_add,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   800
                                     NSCDERIV_CDERIV_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   801
qed "CDERIV_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   802
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   803
(*** lemmas for multiplication ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   804
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   805
Goal "((a::hcomplex)*b) - (c*d) = (b*(a - c)) + (c*(b - d))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   806
by (simp_tac (simpset() addsimps [hcomplex_diff_mult_distrib2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   807
val lemma_nscderiv1 = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   808
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   809
Goal "[| (x + y) / z = hcomplex_of_complex D + yb; z ~= 0; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   810
\        z : CInfinitesimal; yb : CInfinitesimal |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   811
\     ==> x + y @c= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   812
by (forw_inst_tac [("c1","z")] (hcomplex_mult_right_cancel RS iffD2) 1 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   813
    THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   814
by (thin_tac "(x + y) / z = hcomplex_of_complex D + yb" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   815
by (auto_tac (claset() addSIs [CInfinitesimal_CFinite_mult2, CFinite_add],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   816
              simpset() addsimps [mem_cinfmal_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   817
by (etac (CInfinitesimal_subset_CFinite RS subsetD) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   818
val lemma_nscderiv2 = result();
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   819
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   820
Goal "[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   821
\     ==> NSCDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   822
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff, NSCLIM_def]) 1 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   823
    THEN REPEAT(Step_tac 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   824
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   825
       simpset() addsimps [starfunC_lambda_cancel, lemma_nscderiv1,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   826
       hcomplex_of_complex_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   827
by (simp_tac (simpset() addsimps [hcomplex_add_divide_distrib]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   828
by (REPEAT(dtac (bex_CInfinitesimal_iff2 RS iffD2) 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   829
by (auto_tac (claset(),
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 13957
diff changeset
   830
        simpset() delsimps [times_divide_eq_right]
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 13957
diff changeset
   831
		  addsimps [times_divide_eq_right RS sym]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   832
by (rewtac hcomplex_diff_def);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   833
by (dres_inst_tac [("D","Db")] lemma_nscderiv2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   834
by (dtac (capprox_minus_iff RS iffD2 RS (bex_CInfinitesimal_iff2 RS iffD2)) 4);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   835
by (auto_tac (claset() addSIs [capprox_add_mono1],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   836
      simpset() addsimps [hcomplex_add_mult_distrib, hcomplex_add_mult_distrib2, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   837
			  hcomplex_mult_commute, hcomplex_add_assoc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   838
by (res_inst_tac [("w1","hcomplex_of_complex Db * hcomplex_of_complex (f x)")]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   839
    (hcomplex_add_commute RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   840
by (auto_tac (claset() addSIs [CInfinitesimal_add_capprox_self2 RS capprox_sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   841
			       CInfinitesimal_add, CInfinitesimal_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   842
			       CInfinitesimal_hcomplex_of_complex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   843
			       CInfinitesimal_hcomplex_of_complex_mult2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   844
	      simpset() addsimps [hcomplex_add_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   845
qed "NSCDERIV_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   846
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   847
Goal "[| CDERIV f x :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   848
\     ==> CDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   849
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   850
                                           NSCDERIV_CDERIV_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   851
qed "CDERIV_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   852
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   853
Goal "NSCDERIV f x :> D ==> NSCDERIV (%x. c * f x) x :> c*D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   854
by (asm_full_simp_tac 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   855
    (simpset() addsimps [complex_times_divide1_eq RS sym, NSCDERIV_NSCLIM_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   856
                         complex_minus_mult_eq2, complex_add_mult_distrib2 RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   857
                         complex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   858
             delsimps [complex_times_divide1_eq, complex_minus_mult_eq2 RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   859
by (etac (NSCLIM_const RS NSCLIM_mult) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   860
qed "NSCDERIV_cmult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   861
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   862
Goal "CDERIV f x :> D ==> CDERIV (%x. c * f x) x :> c*D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   863
by (auto_tac (claset(),simpset() addsimps [NSCDERIV_cmult,NSCDERIV_CDERIV_iff
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   864
    RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   865
qed "CDERIV_cmult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   866
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   867
Goal "NSCDERIV f x :> D ==> NSCDERIV (%x. -(f x)) x :> -D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   868
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff,complex_diff_def]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   869
by (res_inst_tac [("t","f x")] (complex_minus_minus RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   870
by (asm_simp_tac (simpset() addsimps [complex_minus_add_distrib RS sym] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   871
                   delsimps [complex_minus_add_distrib, complex_minus_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   872
by (etac NSCLIM_minus 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   873
qed "NSCDERIV_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   874
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   875
Goal "CDERIV f x :> D ==> CDERIV (%x. -(f x)) x :> -D";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   876
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_minus,NSCDERIV_CDERIV_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   877
qed "CDERIV_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   878
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   879
Goal "[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   880
\     ==> NSCDERIV (%x. f x + -g x) x :> Da + -Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   881
by (blast_tac (claset() addDs [NSCDERIV_add,NSCDERIV_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   882
qed "NSCDERIV_add_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   883
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   884
Goal "[| CDERIV f x :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   885
\     ==> CDERIV (%x. f x + -g x) x :> Da + -Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   886
by (blast_tac (claset() addDs [CDERIV_add,CDERIV_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   887
qed "CDERIV_add_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   888
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   889
Goalw [complex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   890
     "[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   891
\     ==> NSCDERIV (%x. f x - g x) x :> Da - Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   892
by (blast_tac (claset() addIs [NSCDERIV_add_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   893
qed "NSCDERIV_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   894
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   895
Goalw [complex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   896
     "[| CDERIV f x :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   897
\      ==> CDERIV (%x. f x - g x) x :> Da - Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   898
by (blast_tac (claset() addIs [CDERIV_add_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   899
qed "CDERIV_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   900
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   901
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   902
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   903
(* Chain rule                                       *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   904
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   905
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   906
(* lemmas *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   907
Goalw [nscderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   908
      "[| NSCDERIV g x :> D; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   909
\         ( *fc* g) (hcomplex_of_complex(x) + xa) = hcomplex_of_complex(g x);\
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   910
\         xa : CInfinitesimal; xa ~= 0 \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   911
\      |] ==> D = 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   912
by (dtac bspec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   913
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   914
qed "NSCDERIV_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   915
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   916
Goalw [nscderiv_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   917
     "[| NSCDERIV f x :> D;  h: CInfinitesimal;  h ~= 0 |]  \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   918
\     ==> ( *fc* f) (hcomplex_of_complex(x) + h) - hcomplex_of_complex(f x) @c= 0";    
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   919
by (asm_full_simp_tac (simpset() addsimps [mem_cinfmal_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   920
by (rtac CInfinitesimal_ratio 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   921
by (rtac capprox_hcomplex_of_complex_CFinite 3);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   922
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   923
qed "NSCDERIV_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   924
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   925
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   926
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   927
(* from one version of differentiability            *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   928
(*                                                  *)                                   
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   929
(*   f(x) - f(a)                                    *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   930
(* --------------- @= Db                            *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   931
(*     x - a                                        *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   932
(* -------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   933
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   934
Goal "[| NSCDERIV f (g x) :> Da; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   935
\        ( *fc* g) (hcomplex_of_complex(x) + xa) ~= hcomplex_of_complex (g x); \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   936
\        ( *fc* g) (hcomplex_of_complex(x) + xa) @c= hcomplex_of_complex (g x) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   937
\     |] ==> (( *fc* f) (( *fc* g) (hcomplex_of_complex(x) + xa)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   938
\                     - hcomplex_of_complex (f (g x))) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   939
\             / (( *fc* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex (g x)) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   940
\            @c= hcomplex_of_complex (Da)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   941
by (auto_tac (claset(),simpset() addsimps [NSCDERIV_NSCLIM_iff2, NSCLIM_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   942
qed "NSCDERIVD1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   943
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   944
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   945
(* from other version of differentiability          *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   946
(*                                                  *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   947
(*  f(x + h) - f(x)                                 *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   948
(* ----------------- @= Db                          *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   949
(*         h                                        *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   950
(*--------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   951
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   952
Goal "[| NSCDERIV g x :> Db; xa: CInfinitesimal; xa ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   953
\     ==> (( *fc* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex(g x)) / xa \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   954
\         @c= hcomplex_of_complex (Db)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   955
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   956
    simpset() addsimps [NSCDERIV_NSCLIM_iff, NSCLIM_def, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   957
		mem_cinfmal_iff, starfunC_lambda_cancel]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   958
qed "NSCDERIVD2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   959
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   960
Goal "(z::hcomplex) ~= 0 ==> x*y = (x*inverse(z))*(z*y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   961
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   962
qed "lemma_complex_chain";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   963
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   964
(*** chain rule ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   965
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   966
Goal "[| NSCDERIV f (g x) :> Da; NSCDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   967
\     ==> NSCDERIV (f o g) x :> Da * Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   968
by (asm_simp_tac (simpset() addsimps [NSCDERIV_NSCLIM_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   969
    NSCLIM_def,mem_cinfmal_iff RS sym]) 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   970
by (forw_inst_tac [("f","g")] NSCDERIV_capprox 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   971
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   972
              simpset() addsimps [starfunC_lambda_cancel2, starfunC_o RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   973
by (case_tac "( *fc* g) (hcomplex_of_complex(x) + xa) = hcomplex_of_complex (g x)" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   974
by (dres_inst_tac [("g","g")] NSCDERIV_zero 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   975
by (auto_tac (claset(),simpset() addsimps [hcomplex_divide_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   976
by (res_inst_tac [("z1","( *fc* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex (g x)"),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   977
    ("y1","inverse xa")] (lemma_complex_chain RS ssubst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   978
by (Asm_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   979
by (rtac capprox_mult_hcomplex_of_complex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   980
by (fold_tac [hcomplex_divide_def]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   981
by (blast_tac (claset() addIs [NSCDERIVD2]) 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   982
by (auto_tac (claset() addSIs [NSCDERIVD1] addIs [capprox_minus_iff RS iffD2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   983
    simpset() addsimps [symmetric hcomplex_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   984
qed "NSCDERIV_chain";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   985
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   986
(* standard version *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   987
Goal "[| CDERIV f (g x) :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   988
\     ==> CDERIV (f o g) x :> Da * Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   989
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   990
    NSCDERIV_chain]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   991
qed "CDERIV_chain";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   992
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   993
Goal "[| CDERIV f (g x) :> Da; CDERIV g x :> Db |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   994
\     ==> CDERIV (%x. f (g x)) x :> Da * Db";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   995
by (auto_tac (claset() addDs [CDERIV_chain], simpset() addsimps [o_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   996
qed "CDERIV_chain2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   997
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   998
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   999
(* Differentiation of natural number powers                                           *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1000
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1001
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1002
Goal "NSCDERIV (%x. x) x :> 1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1003
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1004
     simpset() addsimps [NSCDERIV_NSCLIM_iff,NSCLIM_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1005
qed "NSCDERIV_Id";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1006
Addsimps [NSCDERIV_Id];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1007
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1008
Goal "CDERIV (%x. x) x :> 1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1009
by (simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1010
qed "CDERIV_Id";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1011
Addsimps [CDERIV_Id];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1012
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1013
bind_thm ("isContc_Id", CDERIV_Id RS CDERIV_isContc);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1014
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1015
(*derivative of linear multiplication*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1016
Goal "CDERIV (op * c) x :> c";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1017
by (cut_inst_tac [("c","c"),("x","x")] (CDERIV_Id RS CDERIV_cmult) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1018
by (Asm_full_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1019
qed "CDERIV_cmult_Id";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1020
Addsimps [CDERIV_cmult_Id];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1021
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1022
Goal "NSCDERIV (op * c) x :> c";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1023
by (simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1024
qed "NSCDERIV_cmult_Id";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1025
Addsimps [NSCDERIV_cmult_Id];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1026
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1027
Goal "CDERIV (%x. x ^ n) x :> (complex_of_real (real n)) * (x ^ (n - 1))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1028
by (induct_tac "n" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1029
by (dtac (CDERIV_Id RS CDERIV_mult) 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1030
by (auto_tac (claset(), 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1031
              simpset() addsimps [complex_of_real_add RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1032
              complex_add_mult_distrib,real_of_nat_Suc] delsimps [complex_of_real_add]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1033
by (case_tac "n" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1034
by (auto_tac (claset(), 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1035
              simpset() addsimps [complex_mult_assoc, complex_add_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1036
by (auto_tac (claset(),simpset() addsimps [complex_mult_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1037
qed "CDERIV_pow";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1038
Addsimps [CDERIV_pow,simplify (simpset()) CDERIV_pow];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1039
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1040
(* NS version *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1041
Goal "NSCDERIV (%x. x ^ n) x :> complex_of_real (real n) * (x ^ (n - 1))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1042
by (simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1043
qed "NSCDERIV_pow";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1044
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
  1045
Goal "[|CDERIV f x :> D; D = E|] ==> CDERIV f x :> E";
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1046
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1047
qed "lemma_CDERIV_subst";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1048
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1049
(*used once, in NSCDERIV_inverse*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1050
Goal "[| h: CInfinitesimal; x ~= 0 |] ==> hcomplex_of_complex x + h ~= 0";
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
  1051
by (Clarify_tac 1);
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
  1052
by (dtac (thm"equals_zero_I") 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1053
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1054
qed "CInfinitesimal_add_not_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1055
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1056
(*Can't get rid of x ~= 0 because it isn't continuous at zero*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1057
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1058
Goalw [nscderiv_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1059
     "x ~= 0 ==> NSCDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1060
by (rtac ballI 1 THEN Asm_full_simp_tac 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1061
by (forward_tac [CInfinitesimal_add_not_zero] 1);
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 14320
diff changeset
  1062
by (asm_full_simp_tac (simpset() addsimps [hcomplex_add_commute,numeral_2_eq_2]) 2); 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1063
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1064
     simpset() addsimps [starfunC_inverse_inverse,hcomplex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1065
               delsimps [hcomplex_minus_mult_eq1 RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1066
                         hcomplex_minus_mult_eq2 RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1067
by (asm_simp_tac
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
  1068
     (simpset() addsimps [inverse_add,
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 13957
diff changeset
  1069
          inverse_mult_distrib RS sym, hcomplex_minus_inverse RS sym] 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1070
          @ hcomplex_add_ac @ hcomplex_mult_ac 
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 13957
diff changeset
  1071
       delsimps [thm"Ring_and_Field.inverse_minus_eq",
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 13957
diff changeset
  1072
		 inverse_mult_distrib, hcomplex_minus_mult_eq1 RS sym,
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1073
                 hcomplex_minus_mult_eq2 RS sym] ) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1074
by (asm_simp_tac (simpset() addsimps [hcomplex_mult_assoc RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1075
                                      hcomplex_add_mult_distrib2] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1076
         delsimps [hcomplex_minus_mult_eq1 RS sym, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1077
                   hcomplex_minus_mult_eq2 RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1078
by (res_inst_tac [("y"," inverse(- hcomplex_of_complex x * hcomplex_of_complex x)")] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1079
                 capprox_trans 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1080
by (rtac inverse_add_CInfinitesimal_capprox2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1081
by (auto_tac (claset() addSDs [hcomplex_of_complex_CFinite_diff_CInfinitesimal] addIs [CFinite_mult], 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1082
         simpset() addsimps [hcomplex_minus_inverse RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1083
by (rtac CInfinitesimal_CFinite_mult2 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1084
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1085
qed "NSCDERIV_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1086
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1087
Goal "x ~= 0 ==> CDERIV (%x. inverse(x)) x :> (-(inverse x ^ 2))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1088
by (asm_simp_tac (simpset() addsimps [NSCDERIV_inverse,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1089
         NSCDERIV_CDERIV_iff RS sym] delsimps [complexpow_Suc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1090
qed "CDERIV_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1091
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1092
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1093
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1094
(* Derivative of inverse                                                              *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1095
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1096
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1097
Goal "[| CDERIV f x :> d; f(x) ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1098
\     ==> CDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1099
by (rtac (complex_mult_commute RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1100
by (asm_simp_tac (simpset() addsimps [complex_minus_mult_eq1,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1101
    complexpow_inverse] delsimps [complexpow_Suc, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1102
    complex_minus_mult_eq1 RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1103
by (fold_goals_tac [o_def]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1104
by (blast_tac (claset() addSIs [CDERIV_chain,CDERIV_inverse]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1105
qed "CDERIV_inverse_fun";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1106
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1107
Goal "[| NSCDERIV f x :> d; f(x) ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1108
\     ==> NSCDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1109
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1110
            CDERIV_inverse_fun] delsimps [complexpow_Suc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1111
qed "NSCDERIV_inverse_fun";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1112
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1113
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1114
(* Derivative of quotient                                                             *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1115
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1116
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1117
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1118
Goal "x ~= (0::complex) \\<Longrightarrow> (x * inverse(x) ^ 2) = inverse x";
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 14320
diff changeset
  1119
by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1120
qed "lemma_complex_mult_inverse_squared";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1121
Addsimps [lemma_complex_mult_inverse_squared];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1122
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1123
Goalw [complex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1124
     "[| CDERIV f x :> d; CDERIV g x :> e; g(x) ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1125
\      ==> CDERIV (%y. f(y) / (g y)) x :> (d*g(x) - (e*f(x))) / (g(x) ^ 2)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1126
by (dres_inst_tac [("f","g")] CDERIV_inverse_fun 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1127
by (dtac CDERIV_mult 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1128
by (REPEAT(assume_tac 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1129
by (asm_full_simp_tac
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1130
    (simpset() addsimps [complex_divide_def, complex_add_mult_distrib2,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1131
                         complexpow_inverse,complex_minus_mult_eq1] @ complex_mult_ac 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1132
       delsimps [complexpow_Suc, complex_minus_mult_eq1 RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1133
                 complex_minus_mult_eq2 RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1134
qed "CDERIV_quotient";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1135
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1136
Goal "[| NSCDERIV f x :> d; NSCDERIV g x :> e; g(x) ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1137
\      ==> NSCDERIV (%y. f(y) / (g y)) x :> (d*g(x) - (e*f(x))) / (g(x) ^ 2)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1138
by (asm_full_simp_tac (simpset() addsimps [NSCDERIV_CDERIV_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1139
            CDERIV_quotient] delsimps [complexpow_Suc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1140
qed "NSCDERIV_quotient";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1141
 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1142
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1143
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1144
(* Caratheodory formulation of derivative at a point: standard proof                  *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1145
(*------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1146
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1147
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1148
Goalw [CLIM_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1149
      "[| ALL x. x ~= a --> (f x = g x) |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1150
\           ==> (f -- a --C> l) = (g -- a --C> l)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1151
by (auto_tac (claset(), simpset() addsimps [complex_add_minus_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1152
qed "CLIM_equal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1153
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1154
Goal "[| (%x. f(x) + -g(x)) -- a --C> 0; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1155
\        g -- a --C> l |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1156
\      ==> f -- a --C> l";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1157
by (dtac CLIM_add 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1158
by (auto_tac (claset(), simpset() addsimps [complex_add_assoc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1159
qed "CLIM_trans";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1160
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1161
Goal "(CDERIV f x :> l) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1162
\     (EX g. (ALL z. f z - f x = g z * (z - x)) & isContc g x & g x = l)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1163
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1164
by (res_inst_tac 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1165
    [("x","%z. if  z = x then l else (f(z) - f(x)) / (z - x)")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1166
by (auto_tac (claset(),simpset() addsimps [complex_mult_assoc,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1167
    CLAIM "z ~= x ==> z - x ~= (0::complex)"]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1168
by (auto_tac (claset(),simpset() addsimps [isContc_iff,CDERIV_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1169
by (ALLGOALS(rtac (CLIM_equal RS iffD1)));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1170
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1171
qed "CARAT_CDERIV";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1172
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1173
Goal "NSCDERIV f x :> l ==> \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1174
\     EX g. (ALL z. f z - f x = g z * (z - x)) & isNSContc g x & g x = l";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1175
by (auto_tac (claset(),simpset() addsimps [NSCDERIV_CDERIV_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1176
    isNSContc_isContc_iff,CARAT_CDERIV]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1177
qed "CARAT_NSCDERIV";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1178
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1179
(* How about a NS proof? *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1180
Goal "(ALL z. f z - f x = g z * (z - x)) & isNSContc g x & g x = l \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1181
\     ==> NSCDERIV f x :> l";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1182
by (auto_tac (claset(), 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1183
              simpset() delsimprocs complex_cancel_factor
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1184
                        addsimps [NSCDERIV_iff2]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1185
by (asm_full_simp_tac (simpset() addsimps [isNSContc_def]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1186
qed "CARAT_CDERIVD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1187