src/HOL/NSA/HSeries.thy
author wenzelm
Wed, 30 Dec 2015 17:55:43 +0100
changeset 61981 1b5845c62fa0
parent 61975 b4b11391c676
child 61982 3af5a06577c7
permissions -rw-r--r--
more symbols;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     1
(*  Title       : HSeries.thy
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     3
    Copyright   : 1998  University of Cambridge
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     4
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
     5
Converted to Isar and polished by lcp
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
     6
*)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     7
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
     8
section\<open>Finite Summation and Infinite Series for Hyperreals\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     9
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    10
theory HSeries
51525
d3d170a2887f HOL-NSA should only import Complex_Main
hoelzl
parents: 47217
diff changeset
    11
imports HSEQ
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    12
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    13
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    14
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    15
  sumhr :: "(hypnat * hypnat * (nat=>real)) => hypreal" where
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    16
  "sumhr =
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    17
      (%(M,N,f). starfun2 (%m n. setsum f {m..<n}) M N)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    18
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    19
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    20
  NSsums  :: "[nat=>real,real] => bool"     (infixr "NSsums" 80) where
61970
6226261144d7 more symbols;
wenzelm
parents: 61945
diff changeset
    21
  "f NSsums s = (%n. setsum f {..<n}) \<longlonglongrightarrow>\<^sub>N\<^sub>S s"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    22
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    23
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    24
  NSsummable :: "(nat=>real) => bool" where
37765
26bdfb7b680b dropped superfluous [code del]s
haftmann
parents: 30273
diff changeset
    25
  "NSsummable f = (\<exists>s. f NSsums s)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    26
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    27
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    28
  NSsuminf   :: "(nat=>real) => real" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    29
  "NSsuminf f = (THE s. f NSsums s)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    30
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    31
lemma sumhr_app: "sumhr(M,N,f) = ( *f2* (\<lambda>m n. setsum f {m..<n})) M N"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    32
by (simp add: sumhr_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    33
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
    34
text\<open>Base case in definition of @{term sumr}\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    35
lemma sumhr_zero [simp]: "!!m. sumhr (m,0,f) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    36
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    37
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
    38
text\<open>Recursive case in definition of @{term sumr}\<close>
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    39
lemma sumhr_if:
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    40
     "!!m n. sumhr(m,n+1,f) =
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    41
      (if n + 1 \<le> m then 0 else sumhr(m,n,f) + ( *f* f) n)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    42
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    43
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    44
lemma sumhr_Suc_zero [simp]: "!!n. sumhr (n + 1, n, f) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    45
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    46
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    47
lemma sumhr_eq_bounds [simp]: "!!n. sumhr (n,n,f) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    48
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    49
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    50
lemma sumhr_Suc [simp]: "!!m. sumhr (m,m + 1,f) = ( *f* f) m"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    51
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    52
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    53
lemma sumhr_add_lbound_zero [simp]: "!!k m. sumhr(m+k,k,f) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    54
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    55
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    56
lemma sumhr_add:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    57
  "!!m n. sumhr (m,n,f) + sumhr(m,n,g) = sumhr(m,n,%i. f i + g i)"
57418
6ab1c7cb0b8d fact consolidation
haftmann
parents: 56194
diff changeset
    58
unfolding sumhr_app by transfer (rule setsum.distrib [symmetric])
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    59
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    60
lemma sumhr_mult:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    61
  "!!m n. hypreal_of_real r * sumhr(m,n,f) = sumhr(m,n,%n. r * f n)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    62
unfolding sumhr_app by transfer (rule setsum_right_distrib)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    63
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    64
lemma sumhr_split_add:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    65
  "!!n p. n < p ==> sumhr(0,n,f) + sumhr(n,p,f) = sumhr(0,p,f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    66
unfolding sumhr_app by transfer (simp add: setsum_add_nat_ivl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    67
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    68
lemma sumhr_split_diff: "n<p ==> sumhr(0,p,f) - sumhr(0,n,f) = sumhr(n,p,f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    69
by (drule_tac f = f in sumhr_split_add [symmetric], simp)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    70
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
    71
lemma sumhr_hrabs: "!!m n. \<bar>sumhr(m,n,f)\<bar> \<le> sumhr(m,n,%i. \<bar>f i\<bar>)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    72
unfolding sumhr_app by transfer (rule setsum_abs)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    73
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
    74
text\<open>other general version also needed\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    75
lemma sumhr_fun_hypnat_eq:
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    76
   "(\<forall>r. m \<le> r & r < n --> f r = g r) -->
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    77
      sumhr(hypnat_of_nat m, hypnat_of_nat n, f) =
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    78
      sumhr(hypnat_of_nat m, hypnat_of_nat n, g)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    79
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    80
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    81
lemma sumhr_const:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    82
     "!!n. sumhr(0, n, %i. r) = hypreal_of_hypnat n * hypreal_of_real r"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
    83
unfolding sumhr_app by transfer simp
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    84
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    85
lemma sumhr_less_bounds_zero [simp]: "!!m n. n < m ==> sumhr(m,n,f) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    86
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    87
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    88
lemma sumhr_minus: "!!m n. sumhr(m, n, %i. - f i) = - sumhr(m, n, f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    89
unfolding sumhr_app by transfer (rule setsum_negf)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    90
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    91
lemma sumhr_shift_bounds:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    92
  "!!m n. sumhr(m+hypnat_of_nat k,n+hypnat_of_nat k,f) =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    93
          sumhr(m,n,%i. f(i + k))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    94
unfolding sumhr_app by transfer (rule setsum_shift_bounds_nat_ivl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    95
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    96
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
    97
subsection\<open>Nonstandard Sums\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    98
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
    99
text\<open>Infinite sums are obtained by summing to some infinite hypernatural
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
   100
 (such as @{term whn})\<close>
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   101
lemma sumhr_hypreal_of_hypnat_omega:
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   102
      "sumhr(0,whn,%i. 1) = hypreal_of_hypnat whn"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   103
by (simp add: sumhr_const)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   104
61981
1b5845c62fa0 more symbols;
wenzelm
parents: 61975
diff changeset
   105
lemma sumhr_hypreal_omega_minus_one: "sumhr(0, whn, %i. 1) = \<omega> - 1"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   106
apply (simp add: sumhr_const)
61981
1b5845c62fa0 more symbols;
wenzelm
parents: 61975
diff changeset
   107
(* FIXME: need lemma: hypreal_of_hypnat whn = \<omega> - 1 *)
1b5845c62fa0 more symbols;
wenzelm
parents: 61975
diff changeset
   108
(* maybe define \<omega> = hypreal_of_hypnat whn + 1 *)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   109
apply (unfold star_class_defs omega_def hypnat_omega_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   110
              of_hypnat_def star_of_def)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   111
apply (simp add: starfun_star_n starfun2_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   112
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   113
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   114
lemma sumhr_minus_one_realpow_zero [simp]:
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   115
     "!!N. sumhr(0, N + N, %i. (-1) ^ (i+1)) = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   116
unfolding sumhr_app
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   117
apply transfer
56194
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   118
apply (simp del: power_Suc add: mult_2 [symmetric])
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   119
apply (induct_tac N)
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   120
apply simp_all
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   121
done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   122
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   123
lemma sumhr_interval_const:
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   124
     "(\<forall>n. m \<le> Suc n --> f n = r) & m \<le> na
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   125
      ==> sumhr(hypnat_of_nat m,hypnat_of_nat na,f) =
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   126
          (hypreal_of_nat (na - m) * hypreal_of_real r)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   127
unfolding sumhr_app by transfer simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   128
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   129
lemma starfunNat_sumr: "!!N. ( *f* (%n. setsum f {0..<n})) N = sumhr(0,N,f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   130
unfolding sumhr_app by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   131
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   132
lemma sumhr_hrabs_approx [simp]: "sumhr(0, M, f) @= sumhr(0, N, f)
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
   133
      ==> \<bar>sumhr(M, N, f)\<bar> @= 0"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   134
apply (cut_tac x = M and y = N in linorder_less_linear)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   135
apply (auto simp add: approx_refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   136
apply (drule approx_sym [THEN approx_minus_iff [THEN iffD1]])
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   137
apply (auto dest: approx_hrabs
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 51525
diff changeset
   138
            simp add: sumhr_split_diff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   139
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   140
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   141
(*----------------------------------------------------------------
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   142
      infinite sums: Standard and NS theorems
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   143
 ----------------------------------------------------------------*)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   144
lemma sums_NSsums_iff: "(f sums l) = (f NSsums l)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   145
by (simp add: sums_def NSsums_def LIMSEQ_NSLIMSEQ_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   146
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   147
lemma summable_NSsummable_iff: "(summable f) = (NSsummable f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   148
by (simp add: summable_def NSsummable_def sums_NSsums_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   149
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   150
lemma suminf_NSsuminf_iff: "(suminf f) = (NSsuminf f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   151
by (simp add: suminf_def NSsuminf_def sums_NSsums_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   152
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   153
lemma NSsums_NSsummable: "f NSsums l ==> NSsummable f"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   154
by (simp add: NSsums_def NSsummable_def, blast)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   155
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   156
lemma NSsummable_NSsums: "NSsummable f ==> f NSsums (NSsuminf f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   157
apply (simp add: NSsummable_def NSsuminf_def NSsums_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   158
apply (blast intro: theI NSLIMSEQ_unique)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   159
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   160
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   161
lemma NSsums_unique: "f NSsums s ==> (s = NSsuminf f)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   162
by (simp add: suminf_NSsuminf_iff [symmetric] sums_NSsums_iff sums_unique)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   163
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   164
lemma NSseries_zero:
56194
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   165
  "\<forall>m. n \<le> Suc m --> f(m) = 0 ==> f NSsums (setsum f {..<n})"
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   166
by (auto simp add: sums_NSsums_iff [symmetric] not_le[symmetric] intro!: sums_finite)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   167
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   168
lemma NSsummable_NSCauchy:
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   169
     "NSsummable f =
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
   170
      (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. \<bar>sumhr(M,N,f)\<bar> @= 0)"
56194
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   171
apply (auto simp add: summable_NSsummable_iff [symmetric]
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   172
       summable_iff_convergent convergent_NSconvergent_iff atLeast0LessThan[symmetric]
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   173
       NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_sumr)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   174
apply (cut_tac x = M and y = N in linorder_less_linear)
56194
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   175
apply auto
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   176
apply (rule approx_minus_iff [THEN iffD2, THEN approx_sym])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   177
apply (rule_tac [2] approx_minus_iff [THEN iffD2])
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 58878
diff changeset
   178
apply (auto dest: approx_hrabs_zero_cancel
56194
9ffbb4004c81 fix HOL-NSA; move lemmas
hoelzl
parents: 54230
diff changeset
   179
            simp add: sumhr_split_diff atLeast0LessThan[symmetric])
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   180
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   181
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
   182
text\<open>Terms of a convergent series tend to zero\<close>
61970
6226261144d7 more symbols;
wenzelm
parents: 61945
diff changeset
   183
lemma NSsummable_NSLIMSEQ_zero: "NSsummable f ==> f \<longlonglongrightarrow>\<^sub>N\<^sub>S 0"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   184
apply (auto simp add: NSLIMSEQ_def NSsummable_NSCauchy)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   185
apply (drule bspec, auto)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   186
apply (drule_tac x = "N + 1 " in bspec)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   187
apply (auto intro: HNatInfinite_add_one approx_hrabs_zero_cancel)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   188
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   189
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61970
diff changeset
   190
text\<open>Nonstandard comparison test\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   191
lemma NSsummable_comparison_test:
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
   192
     "[| \<exists>N. \<forall>n. N \<le> n --> \<bar>f n\<bar> \<le> g n; NSsummable g |] ==> NSsummable f"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   193
apply (fold summable_NSsummable_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   194
apply (rule summable_comparison_test, simp, assumption)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   195
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   196
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   197
lemma NSsummable_rabs_comparison_test:
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
   198
     "[| \<exists>N. \<forall>n. N \<le> n --> \<bar>f n\<bar> \<le> g n; NSsummable g |]
1135b8de26c3 more symbols;
wenzelm
parents: 61609
diff changeset
   199
      ==> NSsummable (%k. \<bar>f k\<bar>)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   200
apply (rule NSsummable_comparison_test)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   201
apply (auto)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   202
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   203
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   204
end