src/HOL/Complex/NSCA.ML
author paulson
Tue, 03 Feb 2004 11:06:36 +0100
changeset 14373 67a628beb981
parent 14365 3d4df8c166ae
child 14374 61de62096768
permissions -rw-r--r--
tidying of the complex numbers
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       : NSCA.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,2002 University of Edinburgh
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     4
    Description : Infinite, infinitesimal complex number etc! 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     5
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     6
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
     7
val complex_induct = thm"complex.induct";
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
     8
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
     9
13957
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
(* Closure laws for members of (embedded) set standard complex SComplex                 *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    12
(* -------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    13
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    14
Goalw [SComplex_def] "[| (x::hcomplex): SComplex; y: SComplex |] ==> x + y: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    15
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    16
by (res_inst_tac [("x","r + ra")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    17
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    18
qed "SComplex_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    19
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    20
Goalw [SComplex_def] "[| (x::hcomplex): SComplex; y: SComplex |] ==> x * y: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    21
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    22
by (res_inst_tac [("x","r * ra")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    23
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    24
qed "SComplex_mult";
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 [SComplex_def] "x: SComplex ==> inverse x : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    27
by (blast_tac (claset() addIs [hcomplex_of_complex_inverse RS sym]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    28
qed "SComplex_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    29
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    30
Goal "[| x: SComplex;  y: SComplex |] ==> x/y: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    31
by (asm_simp_tac (simpset() addsimps [SComplex_mult,SComplex_inverse,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    32
                                      hcomplex_divide_def]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    33
qed "SComplex_divide";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    34
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    35
Goalw [SComplex_def] "x: SComplex ==> -x : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    36
by (blast_tac (claset() addIs [hcomplex_of_complex_minus RS sym]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    37
qed "SComplex_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    38
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    39
Goal "(-x : SComplex) = (x: SComplex)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    40
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    41
by (etac SComplex_minus 2); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    42
by (dtac SComplex_minus 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    43
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    44
qed "SComplex_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    45
Addsimps [SComplex_minus_iff]; 
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 "[| x + y : SComplex; y: SComplex |] ==> x: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    48
by (dres_inst_tac [("x","y")] SComplex_minus 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    49
by (dtac SComplex_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    50
by (assume_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    51
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    52
qed "SComplex_add_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    53
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    54
Goalw [hcomplex_of_complex_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    55
     "hcmod (hcomplex_of_complex r) : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    56
by (simp_tac (simpset() addsimps [hcmod,SReal_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    57
    hypreal_of_real_def]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    58
qed "SReal_hcmod_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    59
Addsimps [SReal_hcmod_hcomplex_of_complex];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    60
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    61
Goalw [hcomplex_number_of_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    62
    "hcmod (number_of w ::hcomplex) : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    63
by (rtac SReal_hcmod_hcomplex_of_complex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    64
qed "SReal_hcmod_number_of";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    65
Addsimps [SReal_hcmod_number_of];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    66
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    67
Goalw [SComplex_def] "x: SComplex ==> hcmod x : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    68
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    69
qed "SReal_hcmod_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    70
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    71
Goalw [SComplex_def] "hcomplex_of_complex x: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    72
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    73
qed "SComplex_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    74
Addsimps [SComplex_hcomplex_of_complex];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    75
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    76
Goalw [hcomplex_number_of_def] "(number_of w ::hcomplex) : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    77
by (rtac SComplex_hcomplex_of_complex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    78
qed "SComplex_number_of";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    79
Addsimps [SComplex_number_of];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    80
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    81
Goalw [hcomplex_divide_def] "r : SComplex ==> r/(number_of w::hcomplex) : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    82
by (blast_tac (claset() addSIs [SComplex_number_of, SComplex_mult, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    83
                                SComplex_inverse]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    84
qed "SComplex_divide_number_of";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    85
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    86
Goalw [SComplex_def] "{x. hcomplex_of_complex x : SComplex} = (UNIV::complex set)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    87
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    88
qed "SComplex_UNIV_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    89
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    90
Goalw [SComplex_def] "(x: SComplex) = (EX y. x = hcomplex_of_complex y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    91
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    92
qed "SComplex_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    93
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    94
Goalw [SComplex_def] "hcomplex_of_complex `(UNIV::complex set) = SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    95
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    96
qed "hcomplex_of_complex_image";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    97
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    98
Goalw [SComplex_def] "inv hcomplex_of_complex `SComplex = (UNIV::complex set)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    99
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   100
by (rtac (inj_hcomplex_of_complex RS inv_f_f RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   101
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   102
qed "inv_hcomplex_of_complex_image";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   103
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   104
Goalw [SComplex_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   105
      "[| EX x. x: P; P <= SComplex |] ==> EX Q. P = hcomplex_of_complex ` Q";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   106
by (Best_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   107
qed "SComplex_hcomplex_of_complex_image";
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
Goal "[| (x::hcomplex): SComplex; y: SComplex; hcmod x < hcmod y \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   110
\     |] ==> EX r: Reals. hcmod x< r & r < hcmod y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   111
by (auto_tac (claset() addIs [SReal_dense], simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   112
    addsimps [SReal_hcmod_SComplex]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   113
qed "SComplex_SReal_dense";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   114
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   115
Goalw [SComplex_def,SReal_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   116
      "z : SComplex ==> hcmod z : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   117
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   118
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   119
    hcomplex_of_complex_def,cmod_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   120
by (res_inst_tac [("x","cmod r")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   121
by (ultra_tac (claset(),simpset() addsimps [cmod_def]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   122
qed "SComplex_hcmod_SReal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   123
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   124
Goal "0 : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   125
by (auto_tac (claset(),simpset() addsimps [SComplex_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   126
qed "SComplex_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   127
Addsimps [SComplex_zero];
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 "1 : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   130
by (auto_tac (claset(),simpset() addsimps [SComplex_def,hcomplex_of_complex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   131
    hcomplex_one_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   132
qed "SComplex_one";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   133
Addsimps [SComplex_one];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   134
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   135
(*
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   136
Goalw [SComplex_def,SReal_def] "hcmod z : Reals ==> z : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   137
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   138
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   139
    hcomplex_of_complex_def,cmod_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   140
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   141
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   142
(*--------------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   143
(*        Set of finite elements is a subring of the extended complex numbers                 *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   144
(* -------------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   145
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   146
Goalw [CFinite_def] "[|x : CFinite; y : CFinite|] ==> (x+y) : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   147
by (blast_tac (claset() addSIs [SReal_add,hcmod_add_less]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   148
qed "CFinite_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   149
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   150
Goalw [CFinite_def] "[|x : CFinite; y : CFinite|] ==> x*y : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   151
by (blast_tac (claset() addSIs [SReal_mult,hcmod_mult_less]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   152
qed "CFinite_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   153
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   154
Goalw [CFinite_def] "(-x : CFinite) = (x : CFinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   155
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   156
qed "CFinite_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   157
Addsimps [CFinite_minus_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   158
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   159
Goalw [SComplex_def,CFinite_def] "SComplex <= CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   160
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   161
by (res_inst_tac [("x","1 + hcmod(hcomplex_of_complex r)")] bexI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   162
by (auto_tac (claset() addIs [SReal_add],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   163
qed "SComplex_subset_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   164
Addsimps [ SComplex_subset_CFinite];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   165
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   166
Goal "hcmod (hcomplex_of_complex r) : HFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   167
by (auto_tac (claset() addSIs [ SReal_subset_HFinite RS subsetD],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   168
qed "HFinite_hcmod_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   169
Addsimps [HFinite_hcmod_hcomplex_of_complex];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   170
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   171
Goal "hcomplex_of_complex x: CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   172
by (auto_tac (claset() addSIs [ SComplex_subset_CFinite RS subsetD],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   173
qed "CFinite_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   174
Addsimps [CFinite_hcomplex_of_complex];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   175
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   176
Goalw [CFinite_def] "x : CFinite ==> EX t: Reals. hcmod x < t";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   177
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   178
qed "CFiniteD";
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
Goalw [CFinite_def] "(x : CFinite) = (hcmod x : HFinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   181
by (auto_tac (claset(), simpset() addsimps [HFinite_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   182
qed "CFinite_hcmod_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   183
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   184
Goal "number_of w : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   185
by (rtac (SComplex_number_of RS (SComplex_subset_CFinite RS subsetD)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   186
qed "CFinite_number_of";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   187
Addsimps [CFinite_number_of];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   188
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   189
Goal "[|x : CFinite; y <= hcmod x; 0 <= y |] ==> y: HFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   190
by (auto_tac (claset() addIs [HFinite_bounded],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   191
    [CFinite_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   192
qed "CFinite_bounded";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   193
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   194
(*--------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   195
(* Set of complex infinitesimals is a subring of the nonstandard complex numbers        *) 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   196
(*--------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   197
	 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   198
Goalw [CInfinitesimal_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   199
      "x : CInfinitesimal ==> ALL r: Reals. 0 < r --> hcmod x < r";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   200
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   201
qed "CInfinitesimalD";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   202
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   203
Goalw [CInfinitesimal_def] "0 : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   204
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   205
qed "CInfinitesimal_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   206
AddIffs [CInfinitesimal_zero];
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
Goal "x/(2::hcomplex) + x/(2::hcomplex) = x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   209
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   210
qed "hcomplex_sum_of_halves";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   211
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   212
Goalw [CInfinitesimal_def,Infinitesimal_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   213
   "(z : CInfinitesimal) = (hcmod z : Infinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   214
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   215
qed "CInfinitesimal_hcmod_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   216
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   217
Goal "1 ~: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   218
by (simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   219
qed "one_not_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   220
Addsimps [one_not_CInfinitesimal];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   221
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   222
Goal "[| x : CInfinitesimal; y : CInfinitesimal |] ==> (x+y) : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   223
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   224
by (rtac hrabs_le_Infinitesimal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   225
by (res_inst_tac [("y","hcmod y")] Infinitesimal_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   226
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   227
qed "CInfinitesimal_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   228
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   229
Goalw [CInfinitesimal_def] "(-x:CInfinitesimal) = (x:CInfinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   230
by (Full_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   231
qed "CInfinitesimal_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   232
Addsimps [CInfinitesimal_minus_iff];
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
Goal "[| x : CInfinitesimal;  y : CInfinitesimal |] ==> x-y : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   235
by (asm_simp_tac
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   236
    (simpset() addsimps [hcomplex_diff_def, CInfinitesimal_add]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   237
qed "CInfinitesimal_diff";
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
Goal "[| x : CInfinitesimal; y : CInfinitesimal |] ==> (x * y) : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   240
by (auto_tac (claset() addIs [Infinitesimal_mult],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   241
    [CInfinitesimal_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   242
qed "CInfinitesimal_mult";
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
Goal "[| x : CInfinitesimal; y : CFinite |] ==> (x * y) : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   245
by (auto_tac (claset() addIs [Infinitesimal_HFinite_mult],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   246
    addsimps [CInfinitesimal_hcmod_iff,CFinite_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   247
qed "CInfinitesimal_CFinite_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   248
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   249
Goal "[| x : CInfinitesimal; y : CFinite |] ==> (y * x) : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   250
by (auto_tac (claset() addDs [CInfinitesimal_CFinite_mult],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   251
              simpset() addsimps [hcomplex_mult_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   252
qed "CInfinitesimal_CFinite_mult2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   253
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   254
Goalw [CInfinite_def,HInfinite_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   255
   "(z : CInfinite) = (hcmod z : HInfinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   256
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   257
qed "CInfinite_hcmod_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   258
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   259
Goal "x: CInfinite ==> inverse x: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   260
by (auto_tac (claset() addIs [HInfinite_inverse_Infinitesimal],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   261
    simpset() addsimps [CInfinitesimal_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   262
    CInfinite_hcmod_iff,hcmod_hcomplex_inverse]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   263
qed "CInfinite_inverse_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   264
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   265
Goal "[|x: CInfinite; y: CInfinite|] ==> (x*y): CInfinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   266
by (auto_tac (claset() addIs [HInfinite_mult],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   267
    [CInfinite_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   268
qed "CInfinite_mult";
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 [CInfinite_def] "(-x : CInfinite) = (x : CInfinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   271
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   272
qed "CInfinite_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   273
Addsimps [CInfinite_minus_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   274
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   275
Goal "[|a: CFinite; b: CFinite; c: CFinite|] \ 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   276
\     ==> a*a + b*b + c*c : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   277
by (auto_tac (claset() addIs [CFinite_mult,CFinite_add], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   278
qed "CFinite_sum_squares";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   279
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   280
Goal "x ~: CInfinitesimal ==> x ~= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   281
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   282
qed "not_CInfinitesimal_not_zero";
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
Goal "x: CFinite - CInfinitesimal ==> x ~= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   285
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   286
qed "not_CInfinitesimal_not_zero2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   287
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   288
Goal "x : CFinite - CInfinitesimal ==> hcmod x : HFinite - Infinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   289
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff,CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   290
qed "CFinite_diff_CInfinitesimal_hcmod";
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 "[| e : CInfinitesimal; hcmod x < hcmod e |] ==> x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   293
by (auto_tac (claset() addIs [hrabs_less_Infinitesimal],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   294
    addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   295
qed "hcmod_less_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   296
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   297
Goal "[| e : CInfinitesimal; hcmod x <= hcmod e |] ==> x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   298
by (auto_tac (claset() addIs [hrabs_le_Infinitesimal],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   299
    addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   300
qed "hcmod_le_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   301
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   302
Goal  "[| e : CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   303
\         e' : CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   304
\         hcmod e' < hcmod x ; hcmod x < hcmod e \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   305
\      |] ==> x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   306
by (auto_tac (claset() addIs [Infinitesimal_interval],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   307
    addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   308
qed "CInfinitesimal_interval";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   309
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   310
Goal "[| e : CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   311
\        e' : CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   312
\        hcmod e' <= hcmod x ; hcmod x <= hcmod e \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   313
\     |] ==> x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   314
by (auto_tac (claset() addIs [Infinitesimal_interval2],simpset() 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   315
    addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   316
qed "CInfinitesimal_interval2";
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
Goal "[| x ~: CInfinitesimal;  y ~: CInfinitesimal|] ==> (x*y) ~: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   319
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   320
by (dtac not_Infinitesimal_mult 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   321
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   322
qed "not_CInfinitesimal_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   323
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   324
Goal "x*y : CInfinitesimal ==> x : CInfinitesimal | y : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   325
by (auto_tac (claset() addDs [Infinitesimal_mult_disj],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   326
    [CInfinitesimal_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   327
qed "CInfinitesimal_mult_disj";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   328
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   329
Goal "[| x : CFinite - CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   330
\                  y : CFinite - CInfinitesimal \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   331
\               |] ==> (x*y) : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   332
by (Clarify_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   333
by (blast_tac (claset() addDs [CFinite_mult,not_CInfinitesimal_mult]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   334
qed "CFinite_CInfinitesimal_diff_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   335
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   336
Goal "CInfinitesimal <= CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   337
by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   338
    simpset() addsimps [CInfinitesimal_hcmod_iff,CFinite_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   339
qed "CInfinitesimal_subset_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   340
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   341
Goal "x: CInfinitesimal ==> x * hcomplex_of_complex r : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   342
by (auto_tac (claset() addSIs [Infinitesimal_HFinite_mult],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   343
    simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   344
qed "CInfinitesimal_hcomplex_of_complex_mult";
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 "x: CInfinitesimal ==> hcomplex_of_complex r * x: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   347
by (auto_tac (claset() addSIs [Infinitesimal_HFinite_mult2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   348
    simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   349
qed "CInfinitesimal_hcomplex_of_complex_mult2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   350
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
(*--------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   353
(* Infinitely close relation @c=                                                        *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   354
(* -------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   355
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
Goalw [capprox_def,approx_def] "(z @c= w) = (hcmod z @= hcmod w)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   358
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   359
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   360
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   361
Goal "x:CInfinitesimal = (x @c= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   362
by (simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   363
    capprox_def]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   364
qed "mem_cinfmal_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   365
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   366
Goalw [capprox_def,hcomplex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   367
      " (x @c= y) = (x + -y @c= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   368
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   369
qed "capprox_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   370
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   371
Goalw [capprox_def,hcomplex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   372
      " (x @c= y) = (-y + x @c= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   373
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   374
qed "capprox_minus_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   375
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   376
Goalw [capprox_def] "x @c= x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   377
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   378
qed "capprox_refl";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   379
Addsimps [capprox_refl];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   380
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   381
Goalw [capprox_def,CInfinitesimal_def]  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   382
     "x @c= y ==> y @c= x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   383
by (auto_tac (claset() addSDs [bspec],simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   384
    [hcmod_diff_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   385
qed "capprox_sym";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   386
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   387
Goalw [capprox_def]  "[| x @c= y; y @c= z |] ==> x @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   388
by (dtac CInfinitesimal_add 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   389
by (assume_tac 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   390
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   391
qed "capprox_trans";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   392
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   393
Goal "[| r @c= x; s @c= x |] ==> r @c= s";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   394
by (blast_tac (claset() addIs [capprox_sym, capprox_trans]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   395
qed "capprox_trans2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   396
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   397
Goal "[| x @c= r; x @c= s|] ==> r @c= s";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   398
by (blast_tac (claset() addIs [capprox_sym, capprox_trans]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   399
qed "capprox_trans3";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   400
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   401
Goal "(number_of w @c= x) = (x @c= number_of w)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   402
by (blast_tac (claset() addIs [capprox_sym]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   403
qed "number_of_capprox_reorient";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   404
Addsimps [number_of_capprox_reorient];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   405
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   406
Goal "(x-y : CInfinitesimal) = (x @c= y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   407
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   408
              simpset() addsimps [hcomplex_diff_def, capprox_minus_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   409
                                  mem_cinfmal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   410
qed "CInfinitesimal_capprox_minus";
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
Goalw [cmonad_def] "(x @c= y) = (cmonad(x)=cmonad(y))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   413
by (auto_tac (claset() addDs [capprox_sym] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   414
                       addSEs [capprox_trans,equalityCE],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   415
              simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   416
qed "capprox_monad_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   417
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   418
Goal "[| x: CInfinitesimal; y: CInfinitesimal |] ==> x @c= y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   419
by (asm_full_simp_tac (simpset() addsimps [mem_cinfmal_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   420
by (blast_tac (claset() addIs [capprox_trans, capprox_sym]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   421
qed "Infinitesimal_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   422
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   423
val prem1::prem2::rest = 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   424
goalw thy [capprox_def,hcomplex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   425
     "[| a @c= b; c @c= d |] ==> a+c @c= b+d";
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   426
by (rtac (minus_add_distrib RS ssubst) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   427
by (rtac (hcomplex_add_assoc RS ssubst) 1);
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   428
by (res_inst_tac [("b1","c")] (add_left_commute RS subst) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   429
by (rtac (hcomplex_add_assoc RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   430
by (rtac ([prem1,prem2] MRS CInfinitesimal_add) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   431
qed "capprox_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   432
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   433
Goal "a @c= b ==> -a @c= -b";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   434
by (rtac ((capprox_minus_iff RS iffD2) RS capprox_sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   435
by (dtac (capprox_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   436
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   437
qed "capprox_minus";
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
Goal "-a @c= -b ==> a @c= b";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   440
by (auto_tac (claset() addDs [capprox_minus], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   441
qed "capprox_minus2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   442
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   443
Goal "(-a @c= -b) = (a @c= b)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   444
by (blast_tac (claset() addIs [capprox_minus,capprox_minus2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   445
qed "capprox_minus_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   446
Addsimps [capprox_minus_cancel];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   447
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   448
Goal "[| a @c= b; c @c= d |] ==> a + -c @c= b + -d";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   449
by (blast_tac (claset() addSIs [capprox_add,capprox_minus]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   450
qed "capprox_add_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   451
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   452
Goalw [capprox_def,hcomplex_diff_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   453
      "[| a @c= b; c: CFinite|] ==> a*c @c= b*c"; 
14331
8dbbb7cf3637 re-organized numeric lemmas
paulson
parents: 14323
diff changeset
   454
by (asm_full_simp_tac (HOL_ss addsimps [CInfinitesimal_CFinite_mult,
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   455
    minus_mult_left,hcomplex_add_mult_distrib RS sym]) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   456
qed "capprox_mult1";
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 "[|a @c= b; c: CFinite|] ==> c*a @c= c*b"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   459
by (asm_simp_tac (simpset() addsimps [capprox_mult1,hcomplex_mult_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   460
qed "capprox_mult2";
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
Goal "[|u @c= v*x; x @c= y; v: CFinite|] ==> u @c= v*y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   463
by (fast_tac (claset() addIs [capprox_mult2,capprox_trans]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   464
qed "capprox_mult_subst";
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
Goal "[| u @c= x*v; x @c= y; v: CFinite |] ==> u @c= y*v";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   467
by (fast_tac (claset() addIs [capprox_mult1,capprox_trans]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   468
qed "capprox_mult_subst2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   469
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   470
Goal "[| u @c= x*hcomplex_of_complex v; x @c= y |] ==> u @c= y*hcomplex_of_complex v";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   471
by (auto_tac (claset() addIs [capprox_mult_subst2], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   472
qed "capprox_mult_subst_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   473
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   474
Goalw [capprox_def]  "a = b ==> a @c= b";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   475
by (Asm_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   476
qed "capprox_eq_imp";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   477
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   478
Goal "x: CInfinitesimal ==> -x @c= x"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   479
by (fast_tac (HOL_cs addIs [CInfinitesimal_minus_iff RS iffD2,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   480
    mem_cinfmal_iff RS iffD1,capprox_trans2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   481
qed "CInfinitesimal_minus_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   482
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   483
Goalw [capprox_def]  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   484
     "(EX y: CInfinitesimal. x - z = y) = (x @c= z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   485
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   486
qed "bex_CInfinitesimal_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 "(EX y: CInfinitesimal. x = z + y) = (x @c= z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   489
by (asm_full_simp_tac (simpset() addsimps [bex_CInfinitesimal_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   490
by (Force_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   491
qed "bex_CInfinitesimal_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   492
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   493
Goal "[| y: CInfinitesimal; x + y = z |] ==> x @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   494
by (rtac (bex_CInfinitesimal_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   495
by (dtac (CInfinitesimal_minus_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   496
by (auto_tac (claset(), simpset() addsimps [hcomplex_add_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   497
qed "CInfinitesimal_add_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   498
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   499
Goal "y: CInfinitesimal ==> x @c= x + y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   500
by (rtac (bex_CInfinitesimal_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   501
by (dtac (CInfinitesimal_minus_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   502
by (auto_tac (claset(), simpset() addsimps [hcomplex_add_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   503
qed "CInfinitesimal_add_capprox_self";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   504
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   505
Goal "y: CInfinitesimal ==> x @c= y + x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   506
by (auto_tac (claset() addDs [CInfinitesimal_add_capprox_self],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   507
    simpset() addsimps [hcomplex_add_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   508
qed "CInfinitesimal_add_capprox_self2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   509
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   510
Goal "y: CInfinitesimal ==> x @c= x + -y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   511
by (blast_tac (claset() addSIs [CInfinitesimal_add_capprox_self,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   512
                                CInfinitesimal_minus_iff RS iffD2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   513
qed "CInfinitesimal_add_minus_capprox_self";
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 "[| y: CInfinitesimal; x+y @c= z|] ==> x @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   516
by (dres_inst_tac [("x","x")] (CInfinitesimal_add_capprox_self RS capprox_sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   517
by (etac (capprox_trans3 RS capprox_sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   518
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   519
qed "CInfinitesimal_add_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   520
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   521
Goal "[| y: CInfinitesimal; x @c= z + y|] ==> x @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   522
by (dres_inst_tac [("x","z")] (CInfinitesimal_add_capprox_self2  RS capprox_sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   523
by (etac (capprox_trans3 RS capprox_sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   524
by (asm_full_simp_tac (simpset() addsimps [hcomplex_add_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   525
by (etac capprox_sym 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   526
qed "CInfinitesimal_add_right_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   527
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   528
Goal "d + b  @c= d + c ==> b @c= c";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   529
by (dtac (capprox_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   530
by (asm_full_simp_tac (simpset() addsimps 
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   531
    [minus_add_distrib,capprox_minus_iff RS sym] 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   532
    @ add_ac) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   533
qed "capprox_add_left_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   534
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   535
Goal "b + d @c= c + d ==> b @c= c";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   536
by (rtac capprox_add_left_cancel 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   537
by (asm_full_simp_tac (simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   538
    [hcomplex_add_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   539
qed "capprox_add_right_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   540
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   541
Goal "b @c= c ==> d + b @c= d + c";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   542
by (rtac (capprox_minus_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   543
by (asm_full_simp_tac (simpset() addsimps 
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   544
    [capprox_minus_iff RS sym] @ add_ac) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   545
qed "capprox_add_mono1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   546
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   547
Goal "b @c= c ==> b + a @c= c + a";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   548
by (asm_simp_tac (simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   549
    [hcomplex_add_commute,capprox_add_mono1]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   550
qed "capprox_add_mono2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   551
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   552
Goal "(a + b @c= a + c) = (b @c= c)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   553
by (fast_tac (claset() addEs [capprox_add_left_cancel,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   554
    capprox_add_mono1]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   555
qed "capprox_add_left_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   556
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   557
AddIffs [capprox_add_left_iff];
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
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   560
Goal "(b + a @c= c + a) = (b @c= c)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   561
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   562
qed "capprox_add_right_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   563
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   564
AddIffs [capprox_add_right_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   565
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   566
Goal "[| x: CFinite; x @c= y |] ==> y: CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   567
by (dtac (bex_CInfinitesimal_iff2 RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   568
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   569
by (dtac (CInfinitesimal_subset_CFinite RS subsetD 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   570
          RS (CFinite_minus_iff RS iffD2)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   571
by (dtac CFinite_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   572
by (assume_tac 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   573
qed "capprox_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   574
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   575
Goal "x @c= hcomplex_of_complex D ==> x: CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   576
by (rtac (capprox_sym RSN (2,capprox_CFinite)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   577
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   578
qed "capprox_hcomplex_of_complex_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   579
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   580
Goal "[|a @c= b; c @c= d; b: CFinite; d: CFinite|] ==> a*c @c= b*d";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   581
by (rtac capprox_trans 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   582
by (rtac capprox_mult2 2); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   583
by (rtac capprox_mult1 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   584
by (blast_tac (claset() addIs [capprox_CFinite, capprox_sym]) 2);  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   585
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   586
qed "capprox_mult_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   587
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   588
Goal "[|a @c= hcomplex_of_complex b; c @c= hcomplex_of_complex d |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   589
\     ==> a*c @c= hcomplex_of_complex b * hcomplex_of_complex d";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   590
by (blast_tac (claset() addSIs [capprox_mult_CFinite,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   591
            capprox_hcomplex_of_complex_CFinite,CFinite_hcomplex_of_complex]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   592
qed "capprox_mult_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   593
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   594
Goal "[| a: SComplex; a ~= 0; a*x @c= 0 |] ==> x @c= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   595
by (dtac (SComplex_inverse RS (SComplex_subset_CFinite RS subsetD)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   596
by (auto_tac (claset() addDs [capprox_mult2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   597
    simpset() addsimps [hcomplex_mult_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   598
qed "capprox_SComplex_mult_cancel_zero";
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
Goal "[| a: SComplex; x @c= 0 |] ==> x*a @c= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   601
by (auto_tac (claset() addDs [(SComplex_subset_CFinite RS subsetD),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   602
              capprox_mult1], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   603
qed "capprox_mult_SComplex1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   604
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   605
Goal "[| a: SComplex; x @c= 0 |] ==> a*x @c= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   606
by (auto_tac (claset() addDs [(SComplex_subset_CFinite RS subsetD),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   607
              capprox_mult2], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   608
qed "capprox_mult_SComplex2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   609
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   610
Goal "[|a : SComplex; a ~= 0 |] ==> (a*x @c= 0) = (x @c= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   611
by (blast_tac (claset() addIs [capprox_SComplex_mult_cancel_zero,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   612
    capprox_mult_SComplex2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   613
qed "capprox_mult_SComplex_zero_cancel_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   614
Addsimps [capprox_mult_SComplex_zero_cancel_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   615
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   616
Goal "[| a: SComplex; a ~= 0; a* w @c= a*z |] ==> w @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   617
by (dtac (SComplex_inverse RS (SComplex_subset_CFinite RS subsetD)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   618
by (auto_tac (claset() addDs [capprox_mult2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   619
    simpset() addsimps [hcomplex_mult_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   620
qed "capprox_SComplex_mult_cancel";
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
Goal "[| a: SComplex; a ~= 0|] ==> (a* w @c= a*z) = (w @c= z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   623
by (auto_tac (claset() addSIs [capprox_mult2,SComplex_subset_CFinite RS subsetD] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   624
    addIs [capprox_SComplex_mult_cancel], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   625
qed "capprox_SComplex_mult_cancel_iff1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   626
Addsimps [capprox_SComplex_mult_cancel_iff1];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   627
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   628
Goal "(x @c= y) = (hcmod (y - x) @= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   629
by (rtac (capprox_minus_iff RS ssubst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   630
by (auto_tac (claset(),simpset() addsimps [capprox_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   631
    CInfinitesimal_hcmod_iff,mem_infmal_iff,symmetric hcomplex_diff_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   632
    hcmod_diff_commute]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   633
qed "capprox_hcmod_approx_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   634
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   635
Goal "(x @c= 0) = (hcmod x @= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   636
by (auto_tac (claset(),simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   637
    [capprox_hcmod_approx_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   638
qed "capprox_approx_zero_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   639
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   640
Goal "(-x @c= 0) = (x @c= 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   641
by (auto_tac (claset(),simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   642
    [capprox_hcmod_approx_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   643
qed "capprox_minus_zero_cancel_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   644
Addsimps [capprox_minus_zero_cancel_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   645
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   646
Goal "u @c= 0 ==> hcmod(x + u) - hcmod x : Infinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   647
by (res_inst_tac [("e","hcmod u"),("e'","- hcmod u")] Infinitesimal_interval2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   648
by (auto_tac (claset() addDs [capprox_approx_zero_iff RS iffD1], 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   649
    simpset() addsimps [mem_infmal_iff RS sym,hypreal_diff_def]));
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14331
diff changeset
   650
by (res_inst_tac [("c1","hcmod x")] (add_le_cancel_left RS iffD1) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   651
by (auto_tac (claset(),simpset() addsimps [symmetric hypreal_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   652
qed "Infinitesimal_hcmod_add_diff";
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
Goal "u @c= 0 ==> hcmod(x + u) @= hcmod x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   655
by (rtac (approx_minus_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   656
by (auto_tac (claset() addIs [Infinitesimal_hcmod_add_diff],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   657
    simpset() addsimps [mem_infmal_iff RS sym,symmetric hypreal_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   658
qed "approx_hcmod_add_hcmod";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   659
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   660
Goal "x @c= y ==> hcmod x @= hcmod y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   661
by (auto_tac (claset() addIs [approx_hcmod_add_hcmod] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   662
    addSDs [bex_CInfinitesimal_iff2 RS iffD2],simpset() addsimps [mem_cinfmal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   663
qed "capprox_hcmod_approx";
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
(*--------------------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   666
(* zero is the only complex number that is also infinitesimal                           *)
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
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   669
Goal "[| x: SComplex; y: CInfinitesimal; 0 < hcmod x |] ==> hcmod y < hcmod x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   670
by (auto_tac (claset() addSIs [Infinitesimal_less_SReal,SComplex_hcmod_SReal],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   671
    simpset() addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   672
qed "CInfinitesimal_less_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   673
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   674
Goal "y: CInfinitesimal ==> ALL r: SComplex. 0 < hcmod r --> hcmod y < hcmod r";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   675
by (blast_tac (claset() addIs [CInfinitesimal_less_SComplex]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   676
qed "CInfinitesimal_less_SComplex2";
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
Goal "SComplex Int CInfinitesimal = {0}";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   679
by (auto_tac (claset(),simpset() addsimps [SComplex_def,CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   680
by (cut_inst_tac [("r","r")] SReal_hcmod_hcomplex_of_complex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   681
by (dres_inst_tac [("A","Reals")] IntI 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   682
by (subgoal_tac "hcmod (hcomplex_of_complex r) = 0" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   683
by (Asm_full_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   684
by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   685
by (rotate_tac 2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   686
by (Asm_full_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   687
qed "SComplex_Int_CInfinitesimal_zero";
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
Goal "[| x: SComplex; x: CInfinitesimal|] ==> x = 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   690
by (cut_facts_tac [SComplex_Int_CInfinitesimal_zero] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   691
by (Blast_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   692
qed "SComplex_CInfinitesimal_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   693
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   694
Goal "[| x : SComplex; x ~= 0 |] ==> x : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   695
by (auto_tac (claset() addDs [SComplex_CInfinitesimal_zero,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   696
                              SComplex_subset_CFinite RS subsetD], 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   697
              simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   698
qed "SComplex_CFinite_diff_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   699
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   700
Goal "hcomplex_of_complex x ~= 0 ==> hcomplex_of_complex x : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   701
by (rtac SComplex_CFinite_diff_CInfinitesimal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   702
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   703
qed "hcomplex_of_complex_CFinite_diff_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   704
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   705
Goal "(hcomplex_of_complex x : CInfinitesimal) = (x=0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   706
by (auto_tac (claset(), simpset() addsimps [hcomplex_of_complex_zero]));  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   707
by (rtac ccontr 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   708
by (rtac (hcomplex_of_complex_CFinite_diff_CInfinitesimal RS DiffD2) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   709
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   710
qed "hcomplex_of_complex_CInfinitesimal_iff_0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   711
AddIffs [hcomplex_of_complex_CInfinitesimal_iff_0];
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
Goal "number_of w ~= (0::hcomplex) ==> number_of w ~: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   714
by (fast_tac (claset() addDs [SComplex_number_of RS SComplex_CInfinitesimal_zero]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   715
qed "number_of_not_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   716
Addsimps [number_of_not_CInfinitesimal];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   717
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   718
Goal "[| y: SComplex; x @c= y; y~= 0 |] ==> x ~= 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   719
by (auto_tac (claset() addDs [SComplex_CInfinitesimal_zero,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   720
    capprox_sym RS (mem_cinfmal_iff RS iffD2)],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   721
qed "capprox_SComplex_not_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   722
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   723
Goal "[| x @c= y; y : CFinite - CInfinitesimal |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   724
\     ==> x : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   725
by (auto_tac (claset() addIs [capprox_sym RSN (2,capprox_CFinite)],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   726
              simpset() addsimps [mem_cinfmal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   727
by (dtac capprox_trans3 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   728
by (blast_tac (claset() addDs [capprox_sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   729
qed "CFinite_diff_CInfinitesimal_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   730
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   731
Goal "[| y ~= 0;  y: CInfinitesimal;  x/y : CFinite |] ==> x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   732
by (dtac CInfinitesimal_CFinite_mult2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   733
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   734
by (asm_full_simp_tac 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   735
    (simpset() addsimps [hcomplex_divide_def, hcomplex_mult_assoc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   736
qed "CInfinitesimal_ratio";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   737
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   738
Goal "[|x: SComplex; y: SComplex|] ==> (x @c= y) = (x = y)"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   739
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   740
by (rewrite_goals_tac [capprox_def]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   741
by (dres_inst_tac [("x","y")] SComplex_minus 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   742
by (dtac SComplex_add 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   743
by (rtac (CLAIM "x - y = 0 ==> x = (y::hcomplex)") 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   744
by (rtac SComplex_CInfinitesimal_zero 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   745
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   746
qed "SComplex_capprox_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   747
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   748
Goal "(number_of v @c= number_of w) = (number_of v = (number_of w :: hcomplex))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   749
by (rtac SComplex_capprox_iff 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   750
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   751
qed "number_of_capprox_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   752
Addsimps [number_of_capprox_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   753
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   754
Goal "(number_of w : CInfinitesimal) = (number_of w = (0::hcomplex))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   755
by (rtac iffI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   756
by (fast_tac (claset() addDs [SComplex_number_of RS SComplex_CInfinitesimal_zero]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   757
by (Asm_simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   758
qed "number_of_CInfinitesimal_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   759
Addsimps [number_of_CInfinitesimal_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   760
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   761
Goal "(hcomplex_of_complex k @c= hcomplex_of_complex m) = (k = m)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   762
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   763
by (rtac (inj_hcomplex_of_complex RS injD) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   764
by (rtac (SComplex_capprox_iff RS iffD1) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   765
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   766
qed "hcomplex_of_complex_approx_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   767
Addsimps [hcomplex_of_complex_approx_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   768
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   769
Goal "(hcomplex_of_complex k @c= number_of w) = (k = number_of w)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   770
by (stac (hcomplex_of_complex_approx_iff RS sym) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   771
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   772
qed "hcomplex_of_complex_capprox_number_of_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   773
Addsimps [hcomplex_of_complex_capprox_number_of_iff];
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
Goal "[| r: SComplex; s: SComplex; r @c= x; s @c= x|] ==> r = s";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   776
by (blast_tac (claset() addIs [(SComplex_capprox_iff RS iffD1),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   777
               capprox_trans2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   778
qed "capprox_unique_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   779
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   780
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n}) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   781
\     ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) @= \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   782
\         Abs_hypreal(hyprel `` {%n. Re(Y n)})";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   783
by (auto_tac (claset(),simpset() addsimps [approx_FreeUltrafilterNat_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   784
by (dtac (capprox_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   785
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus,hcomplex_add,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   786
    mem_cinfmal_iff RS sym,CInfinitesimal_hcmod_iff,hcmod,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   787
    Infinitesimal_FreeUltrafilterNat_iff2]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   788
by (dres_inst_tac [("x","m")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   789
by (Ultra_tac 1);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   790
by (rename_tac "Z x" 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   791
by (case_tac "X x" 1);
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   792
by (case_tac "Y x" 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   793
by (auto_tac (claset(),simpset() addsimps [complex_minus,complex_add,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   794
    complex_mod] delsimps [realpow_Suc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   795
by (rtac order_le_less_trans 1 THEN assume_tac 2);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   796
by (dres_inst_tac [("t","Z x")] sym 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   797
by (auto_tac (claset(),simpset() addsimps [abs_eqI1] delsimps [realpow_Suc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   798
qed "hcomplex_capproxD1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   799
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   800
(* same proof *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   801
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n}) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   802
\     ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) @= \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   803
\         Abs_hypreal(hyprel `` {%n. Im(Y n)})";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   804
by (auto_tac (claset(),simpset() addsimps [approx_FreeUltrafilterNat_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   805
by (dtac (capprox_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   806
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus,hcomplex_add,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   807
    mem_cinfmal_iff RS sym,CInfinitesimal_hcmod_iff,hcmod,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   808
    Infinitesimal_FreeUltrafilterNat_iff2]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   809
by (dres_inst_tac [("x","m")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   810
by (Ultra_tac 1);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   811
by (rename_tac "Z x" 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   812
by (case_tac "X x" 1);
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   813
by (case_tac "Y x" 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   814
by (auto_tac (claset(),simpset() addsimps [complex_minus,complex_add,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   815
    complex_mod] delsimps [realpow_Suc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   816
by (rtac order_le_less_trans 1 THEN assume_tac 2);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   817
by (dres_inst_tac [("t","Z x")] sym 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   818
by (auto_tac (claset(),simpset() addsimps [abs_eqI1] delsimps [realpow_Suc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   819
qed "hcomplex_capproxD2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   820
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   821
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) @= \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   822
\        Abs_hypreal(hyprel `` {%n. Re(Y n)}); \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   823
\        Abs_hypreal(hyprel `` {%n. Im(X n)}) @= \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   824
\        Abs_hypreal(hyprel `` {%n. Im(Y n)}) \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   825
\     |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n})";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   826
by (dtac (approx_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   827
by (dtac (approx_minus_iff RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   828
by (rtac (capprox_minus_iff RS iffD2) 1);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   829
by (auto_tac (claset(),
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   830
     simpset() addsimps [mem_cinfmal_iff RS sym,
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   831
	    mem_infmal_iff RS sym,hypreal_minus,hypreal_add,hcomplex_minus,
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   832
	    hcomplex_add,CInfinitesimal_hcmod_iff,hcmod,
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   833
	    Infinitesimal_FreeUltrafilterNat_iff]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   834
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   835
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   836
by (dres_inst_tac [("x","u/2")] spec 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   837
by (dres_inst_tac [("x","u/2")] spec 1);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   838
by Safe_tac;
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   839
by (TRYALL(Force_tac));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   840
by (ultra_tac (claset(),HOL_ss) 1);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   841
by (dtac sym 1 THEN dtac sym 1); 
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   842
by (case_tac "X x" 1);
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   843
by (case_tac "Y x" 1);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   844
by (auto_tac (claset(),
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   845
    HOL_ss addsimps [complex_minus,complex_add,
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 14320
diff changeset
   846
    complex_mod, snd_conv, fst_conv,numeral_2_eq_2]));
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   847
by (rename_tac "a b c d" 1);
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   848
by (subgoal_tac "sqrt (abs(a + - c) ^ 2 + abs(b + - d) ^ 2) < u" 1);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   849
by (rtac lemma_sqrt_hcomplex_capprox 2);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   850
by Auto_tac;
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   851
by (asm_full_simp_tac (simpset() addsimps [power2_eq_square]) 1); 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   852
qed "hcomplex_capproxI";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   853
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   854
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n})) =\
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   855
\      (Abs_hypreal(hyprel `` {%n. Re(X n)}) @= Abs_hypreal(hyprel `` {%n. Re(Y n)}) & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   856
\       Abs_hypreal(hyprel `` {%n. Im(X n)}) @= Abs_hypreal(hyprel `` {%n. Im(Y n)}))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   857
by (blast_tac (claset() addIs [hcomplex_capproxI,hcomplex_capproxD1,hcomplex_capproxD2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   858
qed "capprox_approx_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   859
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   860
Goal "(hcomplex_of_hypreal x @c= hcomplex_of_hypreal z) = (x @= z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   861
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   862
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   863
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   864
    capprox_approx_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   865
qed "hcomplex_of_hypreal_capprox_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   866
Addsimps [hcomplex_of_hypreal_capprox_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   867
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   868
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   869
\     ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite";
14365
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   870
by (auto_tac (claset(),
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   871
 simpset() addsimps [CFinite_hcmod_iff,hcmod,HFinite_FreeUltrafilterNat_iff]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   872
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   873
by (res_inst_tac [("x","u")] exI 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   874
by (Ultra_tac 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   875
by (dtac sym 1 THEN case_tac "X x" 1);
14365
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   876
by (auto_tac (claset(),
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   877
    simpset() addsimps [complex_mod,numeral_2_eq_2] delsimps [realpow_Suc]));
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14331
diff changeset
   878
by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   879
by (dtac order_less_le_trans 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   880
by (dtac (real_sqrt_ge_abs1 RSN (2,order_less_le_trans)) 1);
14365
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   881
by (auto_tac ((claset(),simpset() addsimps [numeral_2_eq_2 RS sym]) addIffs [order_less_irrefl]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   882
qed "CFinite_HFinite_Re";
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 "Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   885
\     ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   886
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   887
    hcmod,HFinite_FreeUltrafilterNat_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   888
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   889
by (res_inst_tac [("x","u")] exI 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   890
by (Ultra_tac 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   891
by (dtac sym 1 THEN case_tac "X x" 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   892
by (auto_tac (claset(),simpset() addsimps [complex_mod] delsimps [realpow_Suc]));
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14331
diff changeset
   893
by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   894
by (dtac order_less_le_trans 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   895
by (dtac (real_sqrt_ge_abs2 RSN (2,order_less_le_trans)) 1);
14365
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14353
diff changeset
   896
by (auto_tac (clasimpset() addIffs [order_less_irrefl]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   897
qed "CFinite_HFinite_Im";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   898
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   899
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   900
\        Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   901
\     |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   902
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   903
    hcmod,HFinite_FreeUltrafilterNat_iff]));
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   904
by (rename_tac "Y Z u v" 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   905
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   906
by (res_inst_tac [("x","2*(u + v)")] exI 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   907
by (Ultra_tac 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   908
by (dtac sym 1 THEN case_tac "X x" 1);
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 14320
diff changeset
   909
by (auto_tac (claset(),simpset() addsimps [complex_mod,numeral_2_eq_2] delsimps [realpow_Suc]));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   910
by (subgoal_tac "0 < u" 1 THEN arith_tac 2);
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13957
diff changeset
   911
by (subgoal_tac "0 < v" 1 THEN arith_tac 2);
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   912
by (subgoal_tac "sqrt (abs(Y x) ^ 2 + abs(Z x) ^ 2) < 2*u + 2*v" 1);
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   913
by (rtac lemma_sqrt_hcomplex_capprox 2);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   914
by Auto_tac;
14353
79f9fbef9106 Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents: 14335
diff changeset
   915
by (asm_full_simp_tac (simpset() addsimps [power2_eq_square]) 1); 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   916
qed "HFinite_Re_Im_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   917
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   918
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   919
\     (Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   920
\      Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   921
by (blast_tac (claset() addIs [HFinite_Re_Im_CFinite,CFinite_HFinite_Im,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   922
    CFinite_HFinite_Re]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   923
qed "CFinite_HFinite_iff";
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
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   926
\     ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   927
by (auto_tac (claset(),simpset() addsimps [SComplex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   928
    hcomplex_of_complex_def,SReal_def,hypreal_of_real_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   929
by (res_inst_tac [("x","Re r")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   930
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   931
qed "SComplex_Re_SReal";
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
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   934
\     ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   935
by (auto_tac (claset(),simpset() addsimps [SComplex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   936
    hcomplex_of_complex_def,SReal_def,hypreal_of_real_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   937
by (res_inst_tac [("x","Im r")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   938
by (Ultra_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   939
qed "SComplex_Im_SReal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   940
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   941
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   942
\        Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   943
\     |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   944
by (auto_tac (claset(),simpset() addsimps [SComplex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   945
    hcomplex_of_complex_def,SReal_def,hypreal_of_real_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   946
by (res_inst_tac [("x","complex_of_real r + ii  * complex_of_real ra")] exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   947
by (Ultra_tac 1);
14373
67a628beb981 tidying of the complex numbers
paulson
parents: 14365
diff changeset
   948
by (case_tac "X x" 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   949
by (auto_tac (claset(),simpset() addsimps [complex_of_real_def,i_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   950
    complex_add,complex_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   951
qed "Reals_Re_Im_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   952
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   953
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   954
\     (Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   955
\      Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   956
by (blast_tac (claset() addIs [SComplex_Re_SReal,SComplex_Im_SReal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   957
    Reals_Re_Im_SComplex]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   958
qed "SComplex_SReal_iff";
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 "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CInfinitesimal) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   961
\     (Abs_hypreal(hyprel `` {%n. Re(X n)}) : Infinitesimal & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   962
\      Abs_hypreal(hyprel `` {%n. Im(X n)}) : Infinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   963
by (auto_tac (claset(),simpset() addsimps [mem_cinfmal_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   964
    mem_infmal_iff,hcomplex_zero_num,hypreal_zero_num,capprox_approx_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   965
qed "CInfinitesimal_Infinitesimal_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   966
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   967
(*** more lemmas ****)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   968
Goal "(EX t. P t) = (EX X. P (Abs_hcomplex(hcomplexrel `` {X})))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   969
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   970
by (res_inst_tac [("z","t")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   971
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   972
qed "eq_Abs_hcomplex_EX";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   973
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   974
Goal "(EX t : A. P t) = (EX X. (Abs_hcomplex(hcomplexrel `` {X})) : A & \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   975
\                        P (Abs_hcomplex(hcomplexrel `` {X})))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   976
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   977
by (res_inst_tac [("z","t")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   978
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   979
qed "eq_Abs_hcomplex_Bex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   980
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   981
(* Here we go - easy proof now!! *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   982
Goal "x:CFinite ==> EX t: SComplex. x @c= t";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   983
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   984
by (auto_tac (claset(),simpset() addsimps [CFinite_HFinite_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   985
    eq_Abs_hcomplex_Bex,SComplex_SReal_iff,capprox_approx_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   986
by (REPEAT(dtac st_part_Ex 1 THEN Step_tac 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   987
by (res_inst_tac [("z","t")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   988
by (res_inst_tac [("z","ta")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   989
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   990
by (res_inst_tac [("x","%n. complex_of_real (xa n) + ii * complex_of_real (xb n)")]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   991
    exI 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   992
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   993
qed "stc_part_Ex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   994
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   995
Goal "x:CFinite ==> EX! t. t : SComplex &  x @c= t";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   996
by (dtac stc_part_Ex 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   997
by (dtac capprox_sym 2 THEN dtac capprox_sym 2 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   998
    THEN dtac capprox_sym 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   999
by (auto_tac (claset() addSIs [capprox_unique_complex], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1000
qed "stc_part_Ex1";
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
Goalw [CFinite_def,CInfinite_def] "CFinite Int CInfinite = {}";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1003
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1004
qed "CFinite_Int_CInfinite_empty";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1005
Addsimps [CFinite_Int_CInfinite_empty];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1006
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1007
Goal "x: CFinite ==> x ~: CInfinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1008
by (EVERY1[Step_tac, dtac IntI, assume_tac]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1009
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1010
qed "CFinite_not_CInfinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1011
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1012
Goal "x~: CFinite ==> x: CInfinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1013
by (auto_tac (claset() addIs [not_HFinite_HInfinite],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1014
    simpset() addsimps [CFinite_hcmod_iff,CInfinite_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1015
qed "not_CFinite_CInfinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1016
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1017
Goal "x : CInfinite | x : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1018
by (blast_tac (claset() addIs [not_CFinite_CInfinite]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1019
qed "CInfinite_CFinite_disj";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1020
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1021
Goal "(x : CInfinite) = (x ~: CFinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1022
by (blast_tac (claset() addDs [CFinite_not_CInfinite,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1023
               not_CFinite_CInfinite]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1024
qed "CInfinite_CFinite_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1025
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1026
Goal "(x : CFinite) = (x ~: CInfinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1027
by (simp_tac (simpset() addsimps [CInfinite_CFinite_iff]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1028
qed "CFinite_CInfinite_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1029
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1030
Goal "x ~: CInfinitesimal ==> x : CInfinite | x : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1031
by (fast_tac (claset() addIs [not_CFinite_CInfinite]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1032
qed "CInfinite_diff_CFinite_CInfinitesimal_disj";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1033
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1034
Goal "[| x : CFinite; x ~: CInfinitesimal |] ==> inverse x : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1035
by (cut_inst_tac [("x","inverse x")] CInfinite_CFinite_disj 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1036
by (auto_tac (claset() addSDs [CInfinite_inverse_CInfinitesimal], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1037
qed "CFinite_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1038
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1039
Goal "x : CFinite - CInfinitesimal ==> inverse x : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1040
by (blast_tac (claset() addIs [CFinite_inverse]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1041
qed "CFinite_inverse2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1042
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1043
Goal "x ~: CInfinitesimal ==> inverse(x) : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1044
by (dtac CInfinite_diff_CFinite_CInfinitesimal_disj 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1045
by (blast_tac (claset() addIs [CFinite_inverse,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1046
                 CInfinite_inverse_CInfinitesimal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1047
                 CInfinitesimal_subset_CFinite RS subsetD]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1048
qed "CInfinitesimal_inverse_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1049
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1050
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1051
Goal "x : CFinite - CInfinitesimal ==> inverse x : CFinite - CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1052
by (auto_tac (claset() addIs [CInfinitesimal_inverse_CFinite], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1053
by (dtac CInfinitesimal_CFinite_mult2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1054
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1055
by (asm_full_simp_tac (simpset() addsimps [not_CInfinitesimal_not_zero]) 1); 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1056
qed "CFinite_not_CInfinitesimal_inverse";
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
Goal "[| x @c= y; y :  CFinite - CInfinitesimal |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1059
\     ==> inverse x @c= inverse y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1060
by (forward_tac [CFinite_diff_CInfinitesimal_capprox] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1061
by (assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1062
by (forward_tac [not_CInfinitesimal_not_zero2] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1063
by (forw_inst_tac [("x","x")] not_CInfinitesimal_not_zero2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1064
by (REPEAT(dtac CFinite_inverse2 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1065
by (dtac capprox_mult2 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1066
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1067
by (dres_inst_tac [("c","inverse x")] capprox_mult1 1 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1068
    THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1069
by (auto_tac (claset() addIs [capprox_sym],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1070
    simpset() addsimps [hcomplex_mult_assoc]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1071
qed "capprox_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1072
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1073
bind_thm ("hcomplex_of_complex_capprox_inverse",
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1074
       hcomplex_of_complex_CFinite_diff_CInfinitesimal RSN (2, capprox_inverse));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1075
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1076
Goal "[| x: CFinite - CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1077
\        h : CInfinitesimal |] ==> inverse(x + h) @c= inverse x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1078
by (auto_tac (claset() addIs [capprox_inverse, capprox_sym, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1079
                              CInfinitesimal_add_capprox_self], 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1080
              simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1081
qed "inverse_add_CInfinitesimal_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1082
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1083
Goal "[| x: CFinite - CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1084
\        h : CInfinitesimal |] ==> inverse(h + x) @c= inverse x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1085
by (rtac (hcomplex_add_commute RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1086
by (blast_tac (claset() addIs [inverse_add_CInfinitesimal_capprox]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1087
qed "inverse_add_CInfinitesimal_capprox2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1088
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1089
Goal "[| x : CFinite - CInfinitesimal; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1090
\        h : CInfinitesimal |] ==> inverse(x + h) - inverse x @c= h"; 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1091
by (rtac capprox_trans2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1092
by (auto_tac (claset() addIs [inverse_add_CInfinitesimal_capprox],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1093
              simpset() addsimps [mem_cinfmal_iff,hcomplex_diff_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1094
                                  capprox_minus_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1095
qed "inverse_add_CInfinitesimal_approx_CInfinitesimal";
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 "(x*x : CInfinitesimal) = (x : CInfinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1098
by (auto_tac (claset(), simpset() addsimps [CInfinitesimal_hcmod_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1099
    hcmod_mult]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1100
qed "CInfinitesimal_square_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1101
AddIffs [CInfinitesimal_square_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1102
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1103
Goal "[| a: CFinite-CInfinitesimal; a*w @c= a*z |] ==> w @c= z";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1104
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1105
by (ftac CFinite_inverse 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1106
by (dtac not_CInfinitesimal_not_zero 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1107
by (auto_tac (claset() addDs [capprox_mult2],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1108
    simpset() addsimps [hcomplex_mult_assoc RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1109
qed "capprox_CFinite_mult_cancel";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1110
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1111
Goal "a: CFinite-CInfinitesimal ==> (a * w @c= a * z) = (w @c= z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1112
by (auto_tac (claset() addIs [capprox_mult2,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1113
    capprox_CFinite_mult_cancel], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1114
qed "capprox_CFinite_mult_cancel_iff1";
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
(* Theorems about monads                                                     *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1119
(*---------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1120
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1121
Goalw [cmonad_def] "(x @c= y) = (cmonad(x)=cmonad(y))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1122
by (auto_tac (claset() addDs [capprox_sym] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1123
                       addSEs [capprox_trans,equalityCE],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1124
              simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1125
qed "capprox_cmonad_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1126
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1127
Goal "e : CInfinitesimal ==> cmonad (x+e) = cmonad x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1128
by (fast_tac (claset() addSIs [CInfinitesimal_add_capprox_self RS capprox_sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1129
    capprox_cmonad_iff RS iffD1]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1130
qed "CInfinitesimal_cmonad_eq";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1131
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1132
Goalw [cmonad_def] "(u:cmonad x) = (-u:cmonad (-x))";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1133
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1134
qed "mem_cmonad_iff";
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
Goalw [cmonad_def] "(x:CInfinitesimal) = (x:cmonad 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1137
by (auto_tac (claset() addIs [capprox_sym],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1138
    simpset() addsimps [mem_cinfmal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1139
qed "CInfinitesimal_cmonad_zero_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1140
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1141
Goal "(x:cmonad 0) = (-x:cmonad 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1142
by (simp_tac (simpset() addsimps [CInfinitesimal_cmonad_zero_iff RS sym]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1143
qed "cmonad_zero_minus_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1144
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1145
Goal "(x:cmonad 0) = (hcmod x:monad 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1146
by (auto_tac (claset(), simpset() addsimps 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1147
    [CInfinitesimal_cmonad_zero_iff RS sym,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1148
     CInfinitesimal_hcmod_iff,Infinitesimal_monad_zero_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1149
qed "cmonad_zero_hcmod_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1150
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1151
Goalw [cmonad_def] "x:cmonad x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1152
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1153
qed "mem_cmonad_self";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1154
Addsimps [mem_cmonad_self];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1155
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1156
(*---------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1157
(* Theorems about standard part                                              *)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1158
(*---------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1159
Goalw [stc_def] "x: CFinite ==> stc x @c= x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1160
by (forward_tac [stc_part_Ex] 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1161
by (rtac someI2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1162
by (auto_tac (claset() addIs [capprox_sym], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1163
qed "stc_capprox_self";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1164
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1165
Goalw [stc_def] "x: CFinite ==> stc x: SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1166
by (forward_tac [stc_part_Ex] 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1167
by (rtac someI2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1168
by (auto_tac (claset() addIs [capprox_sym], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1169
qed "stc_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1170
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1171
Goal "x: CFinite ==> stc x: CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1172
by (etac (stc_SComplex RS (SComplex_subset_CFinite RS subsetD)) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1173
qed "stc_CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1174
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1175
Goalw [stc_def] "x: SComplex ==> stc x = x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1176
by (rtac some_equality 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1177
by (auto_tac (claset() addIs [(SComplex_subset_CFinite RS subsetD)],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1178
by (blast_tac (claset() addDs [SComplex_capprox_iff RS iffD1]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1179
qed "stc_SComplex_eq";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1180
Addsimps [stc_SComplex_eq];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1181
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1182
Goal "stc (hcomplex_of_complex x) = hcomplex_of_complex x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1183
by Auto_tac;
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1184
qed "stc_hcomplex_of_complex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1185
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1186
Goal "[| x: CFinite; y: CFinite; stc x = stc y |] ==> x @c= y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1187
by (auto_tac (claset() addSDs [stc_capprox_self] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1188
              addSEs [capprox_trans3], simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1189
qed "stc_eq_capprox";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1190
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1191
Goal "[| x: CFinite; y: CFinite; x @c= y |] ==> stc x = stc y";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1192
by (EVERY1 [forward_tac [stc_capprox_self],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1193
    forw_inst_tac [("x","y")] stc_capprox_self,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1194
    dtac stc_SComplex,dtac stc_SComplex]);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1195
by (fast_tac (claset() addEs [capprox_trans,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1196
    capprox_trans2,SComplex_capprox_iff RS iffD1]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1197
qed "capprox_stc_eq";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1198
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1199
Goal "[| x: CFinite; y: CFinite|] ==> (x @c= y) = (stc x = stc y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1200
by (blast_tac (claset() addIs [capprox_stc_eq,stc_eq_capprox]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1201
qed "stc_eq_capprox_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1202
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1203
Goal "[| x: SComplex; e: CInfinitesimal |] ==> stc(x + e) = x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1204
by (forward_tac [stc_SComplex_eq RS subst] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1205
by (assume_tac 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1206
by (forward_tac [SComplex_subset_CFinite RS subsetD] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1207
by (forward_tac [CInfinitesimal_subset_CFinite RS subsetD] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1208
by (dtac stc_SComplex_eq 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1209
by (rtac capprox_stc_eq 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1210
by (auto_tac (claset() addIs  [CFinite_add],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1211
    simpset() addsimps [CInfinitesimal_add_capprox_self 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1212
    RS capprox_sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1213
qed "stc_CInfinitesimal_add_SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1214
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1215
Goal "[| x: SComplex; e: CInfinitesimal |] ==> stc(e + x) = x";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1216
by (rtac (hcomplex_add_commute RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1217
by (blast_tac (claset() addSIs [stc_CInfinitesimal_add_SComplex]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1218
qed "stc_CInfinitesimal_add_SComplex2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1219
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1220
Goal "x: CFinite ==> EX e: CInfinitesimal. x = stc(x) + e";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1221
by (blast_tac (claset() addSDs [(stc_capprox_self RS 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1222
    capprox_sym),bex_CInfinitesimal_iff2 RS iffD2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1223
qed "CFinite_stc_CInfinitesimal_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1224
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1225
Goal "[| x: CFinite; y: CFinite |] ==> stc (x + y) = stc(x) + stc(y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1226
by (forward_tac [CFinite_stc_CInfinitesimal_add] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1227
by (forw_inst_tac [("x","y")] CFinite_stc_CInfinitesimal_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1228
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1229
by (subgoal_tac "stc (x + y) = stc ((stc x + e) + (stc y + ea))" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1230
by (dtac sym 2 THEN dtac sym 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1231
by (Asm_full_simp_tac 2);
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
  1232
by (asm_simp_tac (simpset() addsimps add_ac) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1233
by (REPEAT(dtac stc_SComplex 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1234
by (dtac SComplex_add 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1235
by (dtac CInfinitesimal_add 1 THEN assume_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1236
by (rtac (hcomplex_add_assoc RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1237
by (blast_tac (claset() addSIs [stc_CInfinitesimal_add_SComplex2]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1238
qed "stc_add";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1239
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1240
Goal "stc (number_of w) = number_of w";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1241
by (rtac (SComplex_number_of RS stc_SComplex_eq) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1242
qed "stc_number_of";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1243
Addsimps [stc_number_of];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1244
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1245
Goal "stc 0 = 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1246
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1247
qed "stc_zero";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1248
Addsimps [stc_zero];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1249
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1250
Goal "stc 1 = 1";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1251
by (Simp_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1252
qed "stc_one";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1253
Addsimps [stc_one];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1254
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1255
Goal "y: CFinite ==> stc(-y) = -stc(y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1256
by (forward_tac [CFinite_minus_iff RS iffD2] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1257
by (rtac hcomplex_add_minus_eq_minus 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1258
by (dtac (stc_add RS sym) 1 THEN assume_tac 1);
14320
fb7a114826be tidying up hcomplex arithmetic
paulson
parents: 14318
diff changeset
  1259
by (asm_simp_tac (simpset() addsimps [add_commute]) 1); 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1260
qed "stc_minus";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1261
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1262
Goalw [hcomplex_diff_def]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1263
     "[| x: CFinite; y: CFinite |] ==> stc (x-y) = stc(x) - stc(y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1264
by (forw_inst_tac [("y1","y")] (stc_minus RS sym) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1265
by (dres_inst_tac [("x1","y")] (CFinite_minus_iff RS iffD2) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1266
by (auto_tac (claset() addIs [stc_add],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1267
qed "stc_diff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1268
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1269
Goal "[| x: CFinite; y: CFinite; \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1270
\        e: CInfinitesimal;       \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1271
\        ea: CInfinitesimal |]   \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1272
\      ==> e*y + x*ea + e*ea: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1273
by (forw_inst_tac [("x","e"),("y","y")] CInfinitesimal_CFinite_mult 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1274
by (forw_inst_tac [("x","ea"),("y","x")] CInfinitesimal_CFinite_mult 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1275
by (dtac CInfinitesimal_mult 3);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1276
by (auto_tac (claset() addIs [CInfinitesimal_add],
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
  1277
              simpset() addsimps add_ac @ mult_ac));
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1278
qed "lemma_stc_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1279
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1280
Goal "[| x: CFinite; y: CFinite |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1281
\              ==> stc (x * y) = stc(x) * stc(y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1282
by (forward_tac [CFinite_stc_CInfinitesimal_add] 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1283
by (forw_inst_tac [("x","y")] CFinite_stc_CInfinitesimal_add 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1284
by (Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1285
by (subgoal_tac "stc (x * y) = stc ((stc x + e) * (stc y + ea))" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1286
by (dtac sym 2 THEN dtac sym 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1287
by (Asm_full_simp_tac 2);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1288
by (thin_tac "x = stc x + e" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1289
by (thin_tac "y = stc y + ea" 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1290
by (asm_full_simp_tac (simpset() addsimps 
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
  1291
    [hcomplex_add_mult_distrib,right_distrib]) 1);
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1292
by (REPEAT(dtac stc_SComplex 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1293
by (full_simp_tac (simpset() addsimps [hcomplex_add_assoc]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1294
by (rtac stc_CInfinitesimal_add_SComplex 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1295
by (blast_tac (claset() addSIs [SComplex_mult]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1296
by (REPEAT(dtac (SComplex_subset_CFinite RS subsetD) 1));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1297
by (rtac (hcomplex_add_assoc RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1298
by (blast_tac (claset() addSIs [lemma_stc_mult]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1299
qed "stc_mult";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1300
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1301
Goal "x: CInfinitesimal ==> stc x = 0";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1302
by (rtac (stc_zero RS subst) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1303
by (rtac capprox_stc_eq 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1304
by (auto_tac (claset() addIs [CInfinitesimal_subset_CFinite RS subsetD],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1305
              simpset() addsimps [mem_cinfmal_iff RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1306
qed "stc_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1307
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1308
Goal "stc(x) ~= 0 ==> x ~: CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1309
by (fast_tac (claset() addIs [stc_CInfinitesimal]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1310
qed "stc_not_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1311
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1312
Goal "[| x: CFinite; stc x ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1313
\     ==> stc(inverse x) = inverse (stc x)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1314
by (res_inst_tac [("c1","stc x")] (hcomplex_mult_left_cancel RS iffD1) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1315
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1316
       simpset() addsimps [stc_mult RS sym, stc_not_CInfinitesimal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1317
                           CFinite_inverse]));
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14299
diff changeset
  1318
by (stac right_inverse 1); 
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1319
by Auto_tac;  
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1320
qed "stc_inverse";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1321
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1322
Goal "[| x: CFinite; y: CFinite; stc y ~= 0 |] \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1323
\     ==> stc(x/y) = (stc x) / (stc y)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1324
by (auto_tac (claset(),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1325
      simpset() addsimps [hcomplex_divide_def, stc_mult, stc_not_CInfinitesimal, 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1326
                          CFinite_inverse, stc_inverse]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1327
qed "stc_divide";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1328
Addsimps [stc_divide];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1329
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1330
Goal "x: CFinite ==> stc(stc(x)) = stc(x)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1331
by (blast_tac (claset() addIs [stc_CFinite, stc_capprox_self,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1332
                               capprox_stc_eq]) 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1333
qed "stc_idempotent";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1334
Addsimps [stc_idempotent];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1335
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1336
Goal "z : HFinite ==> hcomplex_of_hypreal z : CFinite";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1337
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1338
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1339
    CFinite_HFinite_iff,symmetric hypreal_zero_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1340
qed "CFinite_HFinite_hcomplex_of_hypreal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1341
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1342
Goal "x : Reals ==>  hcomplex_of_hypreal x : SComplex";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1343
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1344
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1345
    SComplex_SReal_iff,symmetric hypreal_zero_def]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1346
qed "SComplex_SReal_hcomplex_of_hypreal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1347
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1348
Goalw [st_def,stc_def] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1349
 "z : HFinite ==> stc(hcomplex_of_hypreal z) = hcomplex_of_hypreal (st z)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1350
by (ftac st_part_Ex 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1351
by (rtac someI2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1352
by (auto_tac (claset() addIs [approx_sym],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1353
by (dtac CFinite_HFinite_hcomplex_of_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1354
by (ftac stc_part_Ex 1 THEN Step_tac 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1355
by (rtac someI2 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1356
by (auto_tac (claset() addIs [capprox_sym] addSIs [capprox_unique_complex] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1357
    addDs [SComplex_SReal_hcomplex_of_hypreal],simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1358
qed "stc_hcomplex_of_hypreal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1359
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1360
(*
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1361
Goal "x: CFinite ==> hcmod(stc x) = st(hcmod x)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1362
by (dtac stc_capprox_self 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1363
by (auto_tac (claset(),simpset() addsimps [bex_CInfinitesimal_iff2 RS sym]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1364
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1365
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1366
approx_hcmod_add_hcmod
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1367
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1368
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1369
(*---------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1370
(* More nonstandard complex specific theorems                                *)        
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1371
(*---------------------------------------------------------------------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1372
Goal "(hcnj z : CInfinitesimal) = (z : CInfinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1373
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1374
qed "CInfinitesimal_hcnj_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1375
Addsimps [CInfinitesimal_hcnj_iff];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1376
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1377
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CInfinite) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1378
\     (Abs_hypreal(hyprel `` {%n. Re(X n)}) : HInfinite | \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1379
\      Abs_hypreal(hyprel `` {%n. Im(X n)}) : HInfinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1380
by (auto_tac (claset(),simpset() addsimps [CInfinite_CFinite_iff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1381
    HInfinite_HFinite_iff,CFinite_HFinite_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1382
qed "CInfinite_HInfinite_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1383
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1384
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CInfinitesimal) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1385
\     (x : Infinitesimal & y : Infinitesimal)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1386
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1387
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1388
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1389
    hcomplex_of_hypreal,CInfinitesimal_Infinitesimal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1390
qed "hcomplex_split_CInfinitesimal_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1391
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1392
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CFinite) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1393
\     (x : HFinite & y : HFinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1394
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1395
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1396
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1397
    hcomplex_of_hypreal,CFinite_HFinite_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1398
qed "hcomplex_split_CFinite_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1399
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1400
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : SComplex) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1401
\     (x : Reals & y : Reals)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1402
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1403
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1404
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1405
    hcomplex_of_hypreal,SComplex_SReal_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1406
qed "hcomplex_split_SComplex_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1407
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1408
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CInfinite) = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1409
\     (x : HInfinite | y : HInfinite)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1410
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1411
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1412
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1413
    hcomplex_of_hypreal,CInfinite_HInfinite_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1414
qed "hcomplex_split_CInfinite_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1415
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1416
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y @c= \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1417
\      hcomplex_of_hypreal x' + iii * hcomplex_of_hypreal y') = \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1418
\     (x @= x' & y @= y')";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1419
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1420
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1421
by (res_inst_tac [("z","x'")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1422
by (res_inst_tac [("z","y'")] eq_Abs_hypreal 1);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1423
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1424
    hcomplex_of_hypreal,capprox_approx_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1425
qed "hcomplex_split_capprox_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1426
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1427
(*** More theorems ***)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1428
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1429
Goal "ALL n. cmod (X n - x) < inverse (real (Suc n)) ==> \
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1430
\     Abs_hcomplex(hcomplexrel``{X}) - hcomplex_of_complex x : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1431
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1432
    CInfinitesimal_hcmod_iff,hcomplex_of_complex_def,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1433
    Infinitesimal_FreeUltrafilterNat_iff,hcmod]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1434
by (rtac bexI 1 THEN Auto_tac);
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1435
by (auto_tac (claset() addDs [FreeUltrafilterNat_inverse_real_of_posnat,
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1436
                  FreeUltrafilterNat_all,FreeUltrafilterNat_Int] 
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1437
           addIs [order_less_trans, FreeUltrafilterNat_subset],
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1438
      simpset()));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1439
qed "complex_seq_to_hcomplex_CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1440
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1441
Goal "hcomplex_of_hypreal epsilon : CInfinitesimal";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1442
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1443
qed "CInfinitesimal_hcomplex_of_hypreal_epsilon";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1444
Addsimps [CInfinitesimal_hcomplex_of_hypreal_epsilon];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1445
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1446
Goal "(hcomplex_of_complex z @c= 0) = (z = 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1447
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_zero RS sym]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1448
    delsimps [hcomplex_of_complex_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1449
qed "hcomplex_of_complex_approx_zero_iff";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1450
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1451
Goal "(0 @c= hcomplex_of_complex z) = (z = 0)";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1452
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_zero RS sym]
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1453
    delsimps [hcomplex_of_complex_zero]));
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1454
qed "hcomplex_of_complex_approx_zero_iff2";
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1455
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1456
Addsimps [hcomplex_of_complex_approx_zero_iff,hcomplex_of_complex_approx_zero_iff2];
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1457
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1458