src/HOL/Hyperreal/SEQ.thy
author berghofe
Fri, 01 Jul 2005 13:54:12 +0200
changeset 16633 208ebc9311f2
parent 15539 333a88244569
child 16819 00d8f9300d13
permissions -rw-r--r--
Implemented trick (due to Tobias Nipkow) for fine-tuning simplification of premises of congruence rules.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     1
(*  Title       : SEQ.thy
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     3
    Copyright   : 1998  University of Cambridge
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     4
    Description : Convergence of sequences and series
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
     5
    Conversion to Isar and new proofs by Lawrence C Paulson, 2004
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
     6
*)
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     7
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15102
diff changeset
     8
theory SEQ
15236
f289e8ba2bb3 Proofs needed to be updated because induction now preserves name of
nipkow
parents: 15229
diff changeset
     9
imports NatStar
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15102
diff changeset
    10
begin
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    11
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    12
constdefs
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    13
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    14
  LIMSEQ :: "[nat=>real,real] => bool"    ("((_)/ ----> (_))" [60, 60] 60)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    15
    --{*Standard definition of convergence of sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    16
  "X ----> L == (\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> \<bar>X n + -L\<bar> < r))"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    17
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    18
  NSLIMSEQ :: "[nat=>real,real] => bool"    ("((_)/ ----NS> (_))" [60, 60] 60)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    19
    --{*Nonstandard definition of convergence of sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    20
  "X ----NS> L == (\<forall>N \<in> HNatInfinite. ( *fNat* X) N \<approx> hypreal_of_real L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    21
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    22
  lim :: "(nat => real) => real"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    23
    --{*Standard definition of limit using choice operator*}
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    24
  "lim X == (@L. (X ----> L))"
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    25
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    26
  nslim :: "(nat => real) => real"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    27
    --{*Nonstandard definition of limit using choice operator*}
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    28
  "nslim X == (@L. (X ----NS> L))"
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    29
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    30
  convergent :: "(nat => real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    31
    --{*Standard definition of convergence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    32
  "convergent X == (\<exists>L. (X ----> L))"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    33
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    34
  NSconvergent :: "(nat => real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    35
    --{*Nonstandard definition of convergence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    36
  "NSconvergent X == (\<exists>L. (X ----NS> L))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    37
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    38
  Bseq :: "(nat => real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    39
    --{*Standard definition for bounded sequence*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
    40
  "Bseq X == \<exists>K>0.\<forall>n. \<bar>X n\<bar> \<le> K"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    41
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    42
  NSBseq :: "(nat=>real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    43
    --{*Nonstandard definition for bounded sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    44
  "NSBseq X == (\<forall>N \<in> HNatInfinite. ( *fNat* X) N : HFinite)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    45
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    46
  monoseq :: "(nat=>real)=>bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    47
    --{*Definition for monotonicity*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
    48
  "monoseq X == (\<forall>m. \<forall>n\<ge>m. X m \<le> X n) | (\<forall>m. \<forall>n\<ge>m. X n \<le> X m)"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    49
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    50
  subseq :: "(nat => nat) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    51
    --{*Definition of subsequence*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
    52
  "subseq f == \<forall>m. \<forall>n>m. (f m) < (f n)"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    53
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    54
  Cauchy :: "(nat => real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    55
    --{*Standard definition of the Cauchy condition*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
    56
  "Cauchy X == \<forall>e>0. \<exists>M. \<forall>m \<ge> M. \<forall>n \<ge> M. abs((X m) + -(X n)) < e"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    57
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    58
  NSCauchy :: "(nat => real) => bool"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    59
    --{*Nonstandard definition*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    60
  "NSCauchy X == (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite.
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    61
                      ( *fNat* X) M \<approx> ( *fNat* X) N)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    62
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    63
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    64
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    65
text{* Example of an hypersequence (i.e. an extended standard sequence)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    66
   whose term with an hypernatural suffix is an infinitesimal i.e.
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    67
   the whn'nth term of the hypersequence is a member of Infinitesimal*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    68
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    69
lemma SEQ_Infinitesimal:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    70
      "( *fNat* (%n::nat. inverse(real(Suc n)))) whn : Infinitesimal"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    71
apply (simp add: hypnat_omega_def Infinitesimal_FreeUltrafilterNat_iff starfunNat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    72
apply (rule bexI, rule_tac [2] lemma_hyprel_refl)
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15221
diff changeset
    73
apply (simp add: real_of_nat_Suc_gt_zero FreeUltrafilterNat_inverse_real_of_posnat)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    74
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    75
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    76
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    77
subsection{*LIMSEQ and NSLIMSEQ*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    78
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    79
lemma LIMSEQ_iff:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
    80
      "(X ----> L) = (\<forall>r>0. \<exists>no. \<forall>n \<ge> no. \<bar>X n + -L\<bar> < r)"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    81
by (simp add: LIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    82
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    83
lemma NSLIMSEQ_iff:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    84
    "(X ----NS> L) = (\<forall>N \<in> HNatInfinite. ( *fNat* X) N \<approx> hypreal_of_real L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    85
by (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    86
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    87
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    88
text{*LIMSEQ ==> NSLIMSEQ*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    89
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    90
lemma LIMSEQ_NSLIMSEQ:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    91
      "X ----> L ==> X ----NS> L"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    92
apply (simp add: LIMSEQ_def NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    93
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    94
apply (rule_tac z = N in eq_Abs_hypnat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    95
apply (rule approx_minus_iff [THEN iffD2])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    96
apply (auto simp add: starfunNat mem_infmal_iff [symmetric] hypreal_of_real_def
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    97
              hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    98
apply (rule bexI [OF _ lemma_hyprel_refl], safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
    99
apply (drule_tac x = u in spec, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   100
apply (drule_tac x = no in spec, fuf)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   101
apply (blast dest: less_imp_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   102
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   103
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   104
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   105
text{*NSLIMSEQ ==> LIMSEQ*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   106
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   107
lemma lemma_NSLIMSEQ1: "!!(f::nat=>nat). \<forall>n. n \<le> f n
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   108
           ==> {n. f n = 0} = {0} | {n. f n = 0} = {}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   109
apply auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   110
apply (drule_tac x = xa in spec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   111
apply (drule_tac [2] x = x in spec, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   112
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   113
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   114
lemma lemma_NSLIMSEQ2: "{n. f n \<le> Suc u} = {n. f n \<le> u} Un {n. f n = Suc u}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   115
by (auto simp add: le_Suc_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   116
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   117
lemma lemma_NSLIMSEQ3:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   118
     "!!(f::nat=>nat). \<forall>n. n \<le> f n ==> {n. f n = Suc u} \<le> {n. n \<le> Suc u}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   119
apply auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   120
apply (drule_tac x = x in spec, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   121
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   122
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   123
text{* the following sequence @{term "f(n)"} defines a hypernatural *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   124
lemma NSLIMSEQ_finite_set:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   125
     "!!(f::nat=>nat). \<forall>n. n \<le> f n ==> finite {n. f n \<le> u}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   126
apply (induct u)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   127
apply (auto simp add: lemma_NSLIMSEQ2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   128
apply (auto intro: lemma_NSLIMSEQ3 [THEN finite_subset] finite_atMost [unfolded atMost_def])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   129
apply (drule lemma_NSLIMSEQ1, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   130
apply (simp_all (no_asm_simp)) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   131
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   132
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   133
lemma Compl_less_set: "- {n. u < (f::nat=>nat) n} = {n. f n \<le> u}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   134
by (auto dest: less_le_trans simp add: le_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   135
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   136
text{* the index set is in the free ultrafilter *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   137
lemma FreeUltrafilterNat_NSLIMSEQ:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   138
     "!!(f::nat=>nat). \<forall>n. n \<le> f n ==> {n. u < f n} : FreeUltrafilterNat"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   139
apply (rule FreeUltrafilterNat_Compl_iff2 [THEN iffD2])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   140
apply (rule FreeUltrafilterNat_finite)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   141
apply (auto dest: NSLIMSEQ_finite_set simp add: Compl_less_set)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   142
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   143
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   144
text{* thus, the sequence defines an infinite hypernatural! *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   145
lemma HNatInfinite_NSLIMSEQ: "\<forall>n. n \<le> f n
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   146
          ==> Abs_hypnat (hypnatrel `` {f}) : HNatInfinite"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   147
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   148
apply (rule bexI [OF _ lemma_hypnatrel_refl], safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   149
apply (erule FreeUltrafilterNat_NSLIMSEQ)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   150
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   151
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   152
lemma lemmaLIM:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   153
     "{n. X (f n) + - L = Y n} Int {n. \<bar>Y n\<bar> < r} \<le>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   154
      {n. \<bar>X (f n) + - L\<bar> < r}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   155
by auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   156
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   157
lemma lemmaLIM2:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   158
  "{n. \<bar>X (f n) + - L\<bar> < r} Int {n. r \<le> abs (X (f n) + - (L::real))} = {}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   159
by auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   160
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   161
lemma lemmaLIM3: "[| 0 < r; \<forall>n. r \<le> \<bar>X (f n) + - L\<bar>;
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   162
           ( *fNat* X) (Abs_hypnat (hypnatrel `` {f})) +
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   163
           - hypreal_of_real  L \<approx> 0 |] ==> False"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   164
apply (auto simp add: starfunNat mem_infmal_iff [symmetric] hypreal_of_real_def hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   165
apply (rename_tac "Y")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   166
apply (drule_tac x = r in spec, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   167
apply (drule FreeUltrafilterNat_Int, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   168
apply (drule lemmaLIM [THEN [2] FreeUltrafilterNat_subset])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   169
apply (drule FreeUltrafilterNat_all)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   170
apply (erule_tac V = "{n. \<bar>Y n\<bar> < r} : FreeUltrafilterNat" in thin_rl)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   171
apply (drule FreeUltrafilterNat_Int, assumption)
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15360
diff changeset
   172
apply (simp add: lemmaLIM2)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   173
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   174
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   175
lemma NSLIMSEQ_LIMSEQ: "X ----NS> L ==> X ----> L"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   176
apply (simp add: LIMSEQ_def NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   177
apply (rule ccontr, simp, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   178
txt{* skolemization step *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   179
apply (drule choice, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   180
apply (drule_tac x = "Abs_hypnat (hypnatrel``{f}) " in bspec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   181
apply (drule_tac [2] approx_minus_iff [THEN iffD1])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   182
apply (simp_all add: linorder_not_less)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   183
apply (blast intro: HNatInfinite_NSLIMSEQ)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   184
apply (blast intro: lemmaLIM3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   185
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   186
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   187
text{* Now, the all-important result is trivially proved! *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   188
theorem LIMSEQ_NSLIMSEQ_iff: "(f ----> L) = (f ----NS> L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   189
by (blast intro: LIMSEQ_NSLIMSEQ NSLIMSEQ_LIMSEQ)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   190
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   191
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   192
subsection{*Theorems About Sequences*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   193
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   194
lemma NSLIMSEQ_const: "(%n. k) ----NS> k"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   195
by (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   196
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   197
lemma LIMSEQ_const: "(%n. k) ----> k"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   198
by (simp add: LIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   199
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   200
lemma NSLIMSEQ_add:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   201
      "[| X ----NS> a; Y ----NS> b |] ==> (%n. X n + Y n) ----NS> a + b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   202
by (auto intro: approx_add simp add: NSLIMSEQ_def starfunNat_add [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   203
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   204
lemma LIMSEQ_add: "[| X ----> a; Y ----> b |] ==> (%n. X n + Y n) ----> a + b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   205
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_add)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   206
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   207
lemma NSLIMSEQ_mult:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   208
      "[| X ----NS> a; Y ----NS> b |] ==> (%n. X n * Y n) ----NS> a * b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   209
by (auto intro!: approx_mult_HFinite 
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15360
diff changeset
   210
        simp add: NSLIMSEQ_def starfunNat_mult [symmetric])
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   211
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   212
lemma LIMSEQ_mult: "[| X ----> a; Y ----> b |] ==> (%n. X n * Y n) ----> a * b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   213
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_mult)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   214
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   215
lemma NSLIMSEQ_minus: "X ----NS> a ==> (%n. -(X n)) ----NS> -a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   216
by (auto simp add: NSLIMSEQ_def starfunNat_minus [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   217
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   218
lemma LIMSEQ_minus: "X ----> a ==> (%n. -(X n)) ----> -a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   219
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   220
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   221
lemma LIMSEQ_minus_cancel: "(%n. -(X n)) ----> -a ==> X ----> a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   222
by (drule LIMSEQ_minus, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   223
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   224
lemma NSLIMSEQ_minus_cancel: "(%n. -(X n)) ----NS> -a ==> X ----NS> a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   225
by (drule NSLIMSEQ_minus, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   226
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   227
lemma NSLIMSEQ_add_minus:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   228
     "[| X ----NS> a; Y ----NS> b |] ==> (%n. X n + -Y n) ----NS> a + -b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   229
by (simp add: NSLIMSEQ_add NSLIMSEQ_minus [of Y])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   230
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   231
lemma LIMSEQ_add_minus:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   232
     "[| X ----> a; Y ----> b |] ==> (%n. X n + -Y n) ----> a + -b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   233
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_add_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   234
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   235
lemma LIMSEQ_diff: "[| X ----> a; Y ----> b |] ==> (%n. X n - Y n) ----> a - b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   236
apply (simp add: diff_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   237
apply (blast intro: LIMSEQ_add_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   238
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   239
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   240
lemma NSLIMSEQ_diff:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   241
     "[| X ----NS> a; Y ----NS> b |] ==> (%n. X n - Y n) ----NS> a - b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   242
apply (simp add: diff_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   243
apply (blast intro: NSLIMSEQ_add_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   244
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   245
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   246
text{*Proof is like that of @{text NSLIM_inverse}.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   247
lemma NSLIMSEQ_inverse:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   248
     "[| X ----NS> a;  a ~= 0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   249
by (simp add: NSLIMSEQ_def starfunNat_inverse [symmetric] 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   250
              hypreal_of_real_approx_inverse)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   251
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   252
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   253
text{*Standard version of theorem*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   254
lemma LIMSEQ_inverse:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   255
     "[| X ----> a; a ~= 0 |] ==> (%n. inverse(X n)) ----> inverse(a)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   256
by (simp add: NSLIMSEQ_inverse LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   257
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   258
lemma NSLIMSEQ_mult_inverse:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   259
     "[| X ----NS> a;  Y ----NS> b;  b ~= 0 |] ==> (%n. X n / Y n) ----NS> a/b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   260
by (simp add: NSLIMSEQ_mult NSLIMSEQ_inverse divide_inverse)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   261
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   262
lemma LIMSEQ_divide:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   263
     "[| X ----> a;  Y ----> b;  b ~= 0 |] ==> (%n. X n / Y n) ----> a/b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   264
by (simp add: LIMSEQ_mult LIMSEQ_inverse divide_inverse)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   265
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   266
text{*Uniqueness of limit*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   267
lemma NSLIMSEQ_unique: "[| X ----NS> a; X ----NS> b |] ==> a = b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   268
apply (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   269
apply (drule HNatInfinite_whn [THEN [2] bspec])+
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   270
apply (auto dest: approx_trans3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   271
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   272
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   273
lemma LIMSEQ_unique: "[| X ----> a; X ----> b |] ==> a = b"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   274
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_unique)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   275
15312
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   276
lemma LIMSEQ_setsum:
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   277
  assumes n: "\<And>n. n \<in> S \<Longrightarrow> X n ----> L n"
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   278
  shows "(\<lambda>m. \<Sum>n\<in>S. X n m) ----> (\<Sum>n\<in>S. L n)"
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   279
proof (cases "finite S")
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   280
  case True
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   281
  thus ?thesis using n
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   282
  proof (induct)
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   283
    case empty
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   284
    show ?case
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   285
      by (simp add: LIMSEQ_const)
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   286
  next
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   287
    case insert
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   288
    thus ?case
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   289
      by (simp add: LIMSEQ_add)
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   290
  qed
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   291
next
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   292
  case False
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   293
  thus ?thesis
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   294
    by (simp add: setsum_def LIMSEQ_const)
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   295
qed
7d6e12ead964 added lemma
nipkow
parents: 15251
diff changeset
   296
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   297
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   298
subsection{*Nslim and Lim*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   299
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   300
lemma limI: "X ----> L ==> lim X = L"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   301
apply (simp add: lim_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   302
apply (blast intro: LIMSEQ_unique)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   303
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   304
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   305
lemma nslimI: "X ----NS> L ==> nslim X = L"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   306
apply (simp add: nslim_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   307
apply (blast intro: NSLIMSEQ_unique)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   308
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   309
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   310
lemma lim_nslim_iff: "lim X = nslim X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   311
by (simp add: lim_def nslim_def LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   312
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   313
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   314
subsection{*Convergence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   315
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   316
lemma convergentD: "convergent X ==> \<exists>L. (X ----> L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   317
by (simp add: convergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   318
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   319
lemma convergentI: "(X ----> L) ==> convergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   320
by (auto simp add: convergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   321
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   322
lemma NSconvergentD: "NSconvergent X ==> \<exists>L. (X ----NS> L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   323
by (simp add: NSconvergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   324
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   325
lemma NSconvergentI: "(X ----NS> L) ==> NSconvergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   326
by (auto simp add: NSconvergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   327
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   328
lemma convergent_NSconvergent_iff: "convergent X = NSconvergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   329
by (simp add: convergent_def NSconvergent_def LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   330
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   331
lemma NSconvergent_NSLIMSEQ_iff: "NSconvergent X = (X ----NS> nslim X)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   332
by (auto intro: someI simp add: NSconvergent_def nslim_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   333
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   334
lemma convergent_LIMSEQ_iff: "convergent X = (X ----> lim X)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   335
by (auto intro: someI simp add: convergent_def lim_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   336
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   337
text{*Subsequence (alternative definition, (e.g. Hoskins)*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   338
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   339
lemma subseq_Suc_iff: "subseq f = (\<forall>n. (f n) < (f (Suc n)))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   340
apply (simp add: subseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   341
apply (auto dest!: less_imp_Suc_add)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   342
apply (induct_tac k)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   343
apply (auto intro: less_trans)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   344
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   345
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   346
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   347
subsection{*Monotonicity*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   348
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   349
lemma monoseq_Suc:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   350
   "monoseq X = ((\<forall>n. X n \<le> X (Suc n))
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   351
                 | (\<forall>n. X (Suc n) \<le> X n))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   352
apply (simp add: monoseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   353
apply (auto dest!: le_imp_less_or_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   354
apply (auto intro!: lessI [THEN less_imp_le] dest!: less_imp_Suc_add)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   355
apply (induct_tac "ka")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   356
apply (auto intro: order_trans)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   357
apply (erule swap) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   358
apply (induct_tac "k")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   359
apply (auto intro: order_trans)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   360
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   361
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   362
lemma monoI1: "\<forall>m. \<forall> n \<ge> m. X m \<le> X n ==> monoseq X"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   363
by (simp add: monoseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   364
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   365
lemma monoI2: "\<forall>m. \<forall> n \<ge> m. X n \<le> X m ==> monoseq X"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   366
by (simp add: monoseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   367
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   368
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) ==> monoseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   369
by (simp add: monoseq_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   370
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   371
lemma mono_SucI2: "\<forall>n. X (Suc n) \<le> X n ==> monoseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   372
by (simp add: monoseq_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   373
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   374
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   375
subsection{*Bounded Sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   376
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   377
lemma BseqD: "Bseq X ==> \<exists>K. 0 < K & (\<forall>n. \<bar>X n\<bar> \<le> K)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   378
by (simp add: Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   379
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   380
lemma BseqI: "[| 0 < K; \<forall>n. \<bar>X n\<bar> \<le> K |] ==> Bseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   381
by (auto simp add: Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   382
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   383
lemma lemma_NBseq_def:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   384
     "(\<exists>K > 0. \<forall>n. \<bar>X n\<bar> \<le> K) =
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   385
      (\<exists>N. \<forall>n. \<bar>X n\<bar> \<le> real(Suc N))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   386
apply auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   387
 prefer 2 apply force
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   388
apply (cut_tac x = K in reals_Archimedean2, clarify)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   389
apply (rule_tac x = n in exI, clarify)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   390
apply (drule_tac x = na in spec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   391
apply (auto simp add: real_of_nat_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   392
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   393
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   394
text{* alternative definition for Bseq *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   395
lemma Bseq_iff: "Bseq X = (\<exists>N. \<forall>n. \<bar>X n\<bar> \<le> real(Suc N))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   396
apply (simp add: Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   397
apply (simp (no_asm) add: lemma_NBseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   398
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   399
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   400
lemma lemma_NBseq_def2:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   401
     "(\<exists>K > 0. \<forall>n. \<bar>X n\<bar> \<le> K) = (\<exists>N. \<forall>n. \<bar>X n\<bar> < real(Suc N))"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   402
apply (subst lemma_NBseq_def, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   403
apply (rule_tac x = "Suc N" in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   404
apply (rule_tac [2] x = N in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   405
apply (auto simp add: real_of_nat_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   406
 prefer 2 apply (blast intro: order_less_imp_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   407
apply (drule_tac x = n in spec, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   408
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   409
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   410
(* yet another definition for Bseq *)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   411
lemma Bseq_iff1a: "Bseq X = (\<exists>N. \<forall>n. \<bar>X n\<bar> < real(Suc N))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   412
by (simp add: Bseq_def lemma_NBseq_def2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   413
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   414
lemma NSBseqD: "[| NSBseq X;  N: HNatInfinite |] ==> ( *fNat* X) N : HFinite"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   415
by (simp add: NSBseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   416
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   417
lemma NSBseqI: "\<forall>N \<in> HNatInfinite. ( *fNat* X) N : HFinite ==> NSBseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   418
by (simp add: NSBseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   419
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   420
text{*The standard definition implies the nonstandard definition*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   421
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   422
lemma lemma_Bseq: "\<forall>n. \<bar>X n\<bar> \<le> K ==> \<forall>n. abs(X((f::nat=>nat) n)) \<le> K"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   423
by auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   424
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   425
lemma Bseq_NSBseq: "Bseq X ==> NSBseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   426
apply (simp add: Bseq_def NSBseq_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   427
apply (rule_tac z = N in eq_Abs_hypnat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   428
apply (auto simp add: starfunNat HFinite_FreeUltrafilterNat_iff 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   429
                      HNatInfinite_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   430
apply (rule bexI [OF _ lemma_hyprel_refl]) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   431
apply (drule_tac f = Xa in lemma_Bseq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   432
apply (rule_tac x = "K+1" in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   433
apply (drule_tac P="%n. ?f n \<le> K" in FreeUltrafilterNat_all, ultra)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   434
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   435
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   436
text{*The nonstandard definition implies the standard definition*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   437
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   438
(* similar to NSLIM proof in REALTOPOS *)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   439
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   440
text{* We need to get rid of the real variable and do so by proving the
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   441
   following, which relies on the Archimedean property of the reals.
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   442
   When we skolemize we then get the required function @{term "f::nat=>nat"}.
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   443
   Otherwise, we would be stuck with a skolem function @{term "f::real=>nat"}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   444
   which woulid be useless.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   445
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   446
lemma lemmaNSBseq:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   447
     "\<forall>K > 0. \<exists>n. K < \<bar>X n\<bar>
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   448
      ==> \<forall>N. \<exists>n. real(Suc N) < \<bar>X n\<bar>"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   449
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   450
apply (cut_tac n = N in real_of_nat_Suc_gt_zero, blast)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   451
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   452
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   453
lemma lemmaNSBseq2: "\<forall>K > 0. \<exists>n. K < \<bar>X n\<bar>
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   454
                     ==> \<exists>f. \<forall>N. real(Suc N) < \<bar>X (f N)\<bar>"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   455
apply (drule lemmaNSBseq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   456
apply (drule choice, blast)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   457
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   458
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   459
lemma real_seq_to_hypreal_HInfinite:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   460
     "\<forall>N. real(Suc N) < \<bar>X (f N)\<bar>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   461
      ==>  Abs_hypreal(hyprel``{X o f}) : HInfinite"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   462
apply (auto simp add: HInfinite_FreeUltrafilterNat_iff o_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   463
apply (rule bexI [OF _ lemma_hyprel_refl], clarify)  
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   464
apply (cut_tac u = u in FreeUltrafilterNat_nat_gt_real)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   465
apply (drule FreeUltrafilterNat_all)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   466
apply (erule FreeUltrafilterNat_Int [THEN FreeUltrafilterNat_subset])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   467
apply (auto simp add: real_of_nat_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   468
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   469
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   470
text{* Now prove that we can get out an infinite hypernatural as well
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   471
     defined using the skolem function  @{term "f::nat=>nat"} above*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   472
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   473
lemma lemma_finite_NSBseq:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   474
     "{n. f n \<le> Suc u & real(Suc n) < \<bar>X (f n)\<bar>} \<le>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   475
      {n. f n \<le> u & real(Suc n) < \<bar>X (f n)\<bar>} Un
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   476
      {n. real(Suc n) < \<bar>X (Suc u)\<bar>}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   477
by (auto dest!: le_imp_less_or_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   478
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   479
lemma lemma_finite_NSBseq2:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   480
     "finite {n. f n \<le> (u::nat) &  real(Suc n) < \<bar>X(f n)\<bar>}"
15251
bb6f072c8d10 converted some induct_tac to induct
paulson
parents: 15241
diff changeset
   481
apply (induct "u")
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   482
apply (rule_tac [2] lemma_finite_NSBseq [THEN finite_subset])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   483
apply (rule_tac B = "{n. real (Suc n) < \<bar>X 0\<bar> }" in finite_subset)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   484
apply (auto intro: finite_real_of_nat_less_real 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   485
            simp add: real_of_nat_Suc less_diff_eq [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   486
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   487
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   488
lemma HNatInfinite_skolem_f:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   489
     "\<forall>N. real(Suc N) < \<bar>X (f N)\<bar>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   490
      ==> Abs_hypnat(hypnatrel``{f}) : HNatInfinite"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   491
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   492
apply (rule bexI [OF _ lemma_hypnatrel_refl], safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   493
apply (rule ccontr, drule FreeUltrafilterNat_Compl_mem)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   494
apply (rule lemma_finite_NSBseq2 [THEN FreeUltrafilterNat_finite, THEN notE]) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   495
apply (subgoal_tac "{n. f n \<le> u & real (Suc n) < \<bar>X (f n)\<bar>} =
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   496
                    {n. f n \<le> u} \<inter> {N. real (Suc N) < \<bar>X (f N)\<bar>}")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   497
apply (erule ssubst) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   498
 apply (auto simp add: linorder_not_less Compl_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   499
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   500
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   501
lemma NSBseq_Bseq: "NSBseq X ==> Bseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   502
apply (simp add: Bseq_def NSBseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   503
apply (rule ccontr)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   504
apply (auto simp add: linorder_not_less [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   505
apply (drule lemmaNSBseq2, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   506
apply (frule_tac X = X and f = f in real_seq_to_hypreal_HInfinite)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   507
apply (drule HNatInfinite_skolem_f [THEN [2] bspec])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   508
apply (auto simp add: starfunNat o_def HFinite_HInfinite_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   509
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   510
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   511
text{* Equivalence of nonstandard and standard definitions
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   512
  for a bounded sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   513
lemma Bseq_NSBseq_iff: "(Bseq X) = (NSBseq X)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   514
by (blast intro!: NSBseq_Bseq Bseq_NSBseq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   515
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   516
text{*A convergent sequence is bounded: 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   517
 Boundedness as a necessary condition for convergence. 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   518
 The nonstandard version has no existential, as usual *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   519
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   520
lemma NSconvergent_NSBseq: "NSconvergent X ==> NSBseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   521
apply (simp add: NSconvergent_def NSBseq_def NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   522
apply (blast intro: HFinite_hypreal_of_real approx_sym approx_HFinite)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   523
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   524
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   525
text{*Standard Version: easily now proved using equivalence of NS and
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   526
 standard definitions *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   527
lemma convergent_Bseq: "convergent X ==> Bseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   528
by (simp add: NSconvergent_NSBseq convergent_NSconvergent_iff Bseq_NSBseq_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   529
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   530
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   531
subsection{*Upper Bounds and Lubs of Bounded Sequences*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   532
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   533
lemma Bseq_isUb:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   534
  "!!(X::nat=>real). Bseq X ==> \<exists>U. isUb (UNIV::real set) {x. \<exists>n. X n = x} U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   535
by (auto intro: isUbI setleI simp add: Bseq_def abs_le_interval_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   536
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   537
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   538
text{* Use completeness of reals (supremum property)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   539
   to show that any bounded sequence has a least upper bound*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   540
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   541
lemma Bseq_isLub:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   542
  "!!(X::nat=>real). Bseq X ==>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   543
   \<exists>U. isLub (UNIV::real set) {x. \<exists>n. X n = x} U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   544
by (blast intro: reals_complete Bseq_isUb)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   545
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   546
lemma NSBseq_isUb: "NSBseq X ==> \<exists>U. isUb UNIV {x. \<exists>n. X n = x} U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   547
by (simp add: Bseq_NSBseq_iff [symmetric] Bseq_isUb)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   548
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   549
lemma NSBseq_isLub: "NSBseq X ==> \<exists>U. isLub UNIV {x. \<exists>n. X n = x} U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   550
by (simp add: Bseq_NSBseq_iff [symmetric] Bseq_isLub)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   551
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   552
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   553
subsection{*A Bounded and Monotonic Sequence Converges*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   554
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   555
lemma lemma_converg1:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   556
     "!!(X::nat=>real). [| \<forall>m. \<forall> n \<ge> m. X m \<le> X n;
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   557
                  isLub (UNIV::real set) {x. \<exists>n. X n = x} (X ma)
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   558
               |] ==> \<forall>n \<ge> ma. X n = X ma"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   559
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   560
apply (drule_tac y = "X n" in isLubD2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   561
apply (blast dest: order_antisym)+
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   562
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   563
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   564
text{* The best of both worlds: Easier to prove this result as a standard
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   565
   theorem and then use equivalence to "transfer" it into the
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   566
   equivalent nonstandard form if needed!*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   567
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   568
lemma Bmonoseq_LIMSEQ: "\<forall>n. m \<le> n --> X n = X m ==> \<exists>L. (X ----> L)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   569
apply (simp add: LIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   570
apply (rule_tac x = "X m" in exI, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   571
apply (rule_tac x = m in exI, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   572
apply (drule spec, erule impE, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   573
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   574
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   575
text{*Now, the same theorem in terms of NS limit *}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   576
lemma Bmonoseq_NSLIMSEQ: "\<forall>n \<ge> m. X n = X m ==> \<exists>L. (X ----NS> L)"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   577
by (auto dest!: Bmonoseq_LIMSEQ simp add: LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   578
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   579
lemma lemma_converg2:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   580
   "!!(X::nat=>real).
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   581
    [| \<forall>m. X m ~= U;  isLub UNIV {x. \<exists>n. X n = x} U |] ==> \<forall>m. X m < U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   582
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   583
apply (drule_tac y = "X m" in isLubD2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   584
apply (auto dest!: order_le_imp_less_or_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   585
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   586
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   587
lemma lemma_converg3: "!!(X ::nat=>real). \<forall>m. X m \<le> U ==> isUb UNIV {x. \<exists>n. X n = x} U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   588
by (rule setleI [THEN isUbI], auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   589
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   590
text{* FIXME: @{term "U - T < U"} is redundant *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   591
lemma lemma_converg4: "!!(X::nat=> real).
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   592
               [| \<forall>m. X m ~= U;
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   593
                  isLub UNIV {x. \<exists>n. X n = x} U;
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   594
                  0 < T;
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   595
                  U + - T < U
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   596
               |] ==> \<exists>m. U + -T < X m & X m < U"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   597
apply (drule lemma_converg2, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   598
apply (rule ccontr, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   599
apply (simp add: linorder_not_less)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   600
apply (drule lemma_converg3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   601
apply (drule isLub_le_isUb, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   602
apply (auto dest: order_less_le_trans)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   603
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   604
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   605
text{*A standard proof of the theorem for monotone increasing sequence*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   606
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   607
lemma Bseq_mono_convergent:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   608
     "[| Bseq X; \<forall>m. \<forall>n \<ge> m. X m \<le> X n |] ==> convergent X"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   609
apply (simp add: convergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   610
apply (frule Bseq_isLub, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   611
apply (case_tac "\<exists>m. X m = U", auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   612
apply (blast dest: lemma_converg1 Bmonoseq_LIMSEQ)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   613
(* second case *)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   614
apply (rule_tac x = U in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   615
apply (subst LIMSEQ_iff, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   616
apply (frule lemma_converg2, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   617
apply (drule lemma_converg4, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   618
apply (rule_tac x = m in exI, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   619
apply (subgoal_tac "X m \<le> X n")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   620
 prefer 2 apply blast
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   621
apply (drule_tac x=n and P="%m. X m < U" in spec, arith)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   622
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   623
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   624
text{*Nonstandard version of the theorem*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   625
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   626
lemma NSBseq_mono_NSconvergent:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   627
     "[| NSBseq X; \<forall>m. \<forall>n \<ge> m. X m \<le> X n |] ==> NSconvergent X"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   628
by (auto intro: Bseq_mono_convergent 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   629
         simp add: convergent_NSconvergent_iff [symmetric] 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   630
                   Bseq_NSBseq_iff [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   631
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   632
lemma convergent_minus_iff: "(convergent X) = (convergent (%n. -(X n)))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   633
apply (simp add: convergent_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   634
apply (auto dest: LIMSEQ_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   635
apply (drule LIMSEQ_minus, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   636
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   637
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   638
lemma Bseq_minus_iff: "Bseq (%n. -(X n)) = Bseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   639
by (simp add: Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   640
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   641
text{*Main monotonicity theorem*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   642
lemma Bseq_monoseq_convergent: "[| Bseq X; monoseq X |] ==> convergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   643
apply (simp add: monoseq_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   644
apply (rule_tac [2] convergent_minus_iff [THEN ssubst])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   645
apply (drule_tac [2] Bseq_minus_iff [THEN ssubst])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   646
apply (auto intro!: Bseq_mono_convergent)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   647
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   648
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   649
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   650
subsection{*A Few More Equivalence Theorems for Boundedness*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   651
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   652
text{*alternative formulation for boundedness*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   653
lemma Bseq_iff2: "Bseq X = (\<exists>k > 0. \<exists>x. \<forall>n. \<bar>X(n) + -x\<bar> \<le> k)"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   654
apply (unfold Bseq_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   655
apply (rule_tac [2] x = "k + \<bar>x\<bar> " in exI)
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   656
apply (rule_tac x = K in exI, simp)
15221
8412cfdf3287 tweaking of arithmetic proofs
paulson
parents: 15140
diff changeset
   657
apply (rule exI [where x = 0], auto)
8412cfdf3287 tweaking of arithmetic proofs
paulson
parents: 15140
diff changeset
   658
apply (drule_tac x=n in spec, arith)+
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   659
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   660
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   661
text{*alternative formulation for boundedness*}
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   662
lemma Bseq_iff3: "Bseq X = (\<exists>k > 0. \<exists>N. \<forall>n. abs(X(n) + -X(N)) \<le> k)"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   663
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   664
apply (simp add: Bseq_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   665
apply (rule_tac x = "K + \<bar>X N\<bar> " in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   666
apply auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   667
apply arith
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   668
apply (rule_tac x = N in exI, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   669
apply (drule_tac x = n in spec, arith)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   670
apply (auto simp add: Bseq_iff2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   671
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   672
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   673
lemma BseqI2: "(\<forall>n. k \<le> f n & f n \<le> K) ==> Bseq f"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   674
apply (simp add: Bseq_def)
15221
8412cfdf3287 tweaking of arithmetic proofs
paulson
parents: 15140
diff changeset
   675
apply (rule_tac x = " (\<bar>k\<bar> + \<bar>K\<bar>) + 1" in exI, auto)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   676
apply (drule_tac [2] x = n in spec, arith+)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   677
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   678
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   679
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   680
subsection{*Equivalence Between NS and Standard Cauchy Sequences*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   681
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   682
subsubsection{*Standard Implies Nonstandard*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   683
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   684
lemma lemmaCauchy1:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   685
     "Abs_hypnat (hypnatrel `` {x}) : HNatInfinite
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   686
      ==> {n. M \<le> x n} : FreeUltrafilterNat"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   687
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   688
apply (drule_tac x = M in spec, ultra)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   689
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   690
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   691
lemma lemmaCauchy2:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   692
     "{n. \<forall>m n. M \<le> m & M \<le> (n::nat) --> \<bar>X m + - X n\<bar> < u} Int
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   693
      {n. M \<le> xa n} Int {n. M \<le> x n} \<le>
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   694
      {n. abs (X (xa n) + - X (x n)) < u}"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   695
by blast
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   696
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   697
lemma Cauchy_NSCauchy: "Cauchy X ==> NSCauchy X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   698
apply (simp add: Cauchy_def NSCauchy_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   699
apply (rule_tac z = M in eq_Abs_hypnat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   700
apply (rule_tac z = N in eq_Abs_hypnat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   701
apply (rule approx_minus_iff [THEN iffD2])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   702
apply (rule mem_infmal_iff [THEN iffD1])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   703
apply (auto simp add: starfunNat hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   704
apply (rule bexI, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   705
apply (drule spec, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   706
apply (drule_tac M = M in lemmaCauchy1)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   707
apply (drule_tac M = M in lemmaCauchy1)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   708
apply (rule_tac x1 = xa in lemmaCauchy2 [THEN [2] FreeUltrafilterNat_subset])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   709
apply (rule FreeUltrafilterNat_Int)
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15360
diff changeset
   710
apply (auto intro: FreeUltrafilterNat_Int)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   711
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   712
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   713
subsubsection{*Nonstandard Implies Standard*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   714
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   715
lemma NSCauchy_Cauchy: "NSCauchy X ==> Cauchy X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   716
apply (auto simp add: Cauchy_def NSCauchy_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   717
apply (rule ccontr, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   718
apply (auto dest!: choice HNatInfinite_NSLIMSEQ simp add: all_conj_distrib)  
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   719
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   720
apply (drule_tac x = "Abs_hypnat (hypnatrel `` {fa}) " in bspec); 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   721
apply (auto simp add: starfunNat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   722
apply (drule approx_minus_iff [THEN iffD1])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   723
apply (drule mem_infmal_iff [THEN iffD2])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   724
apply (auto simp add: hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   725
apply (rename_tac "Y")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   726
apply (drule_tac x = e in spec, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   727
apply (drule FreeUltrafilterNat_Int, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   728
apply (subgoal_tac "{n. \<bar>X (f n) + - X (fa n)\<bar> < e} \<in> \<U>") 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   729
 prefer 2 apply (erule FreeUltrafilterNat_subset, force) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   730
apply (rule FreeUltrafilterNat_empty [THEN notE]) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   731
apply (subgoal_tac
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   732
         "{n. abs (X (f n) + - X (fa n)) < e} Int 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   733
          {M. ~ abs (X (f M) + - X (fa M)) < e}  =  {}")
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   734
apply auto  
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   735
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   736
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   737
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   738
theorem NSCauchy_Cauchy_iff: "NSCauchy X = Cauchy X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   739
by (blast intro!: NSCauchy_Cauchy Cauchy_NSCauchy)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   740
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   741
text{*A Cauchy sequence is bounded -- this is the standard
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   742
  proof mechanization rather than the nonstandard proof*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   743
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   744
lemma lemmaCauchy: "\<forall>n \<ge> M. \<bar>X M + - X n\<bar> < (1::real)
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   745
          ==>  \<forall>n \<ge> M. \<bar>X n\<bar> < 1 + \<bar>X M\<bar>"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   746
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   747
apply (drule spec, auto, arith)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   748
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   749
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   750
lemma less_Suc_cancel_iff: "(n < Suc M) = (n \<le> M)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   751
by auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   752
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   753
text{* FIXME: Long. Maximal element in subsequence *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   754
lemma SUP_rabs_subseq:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   755
     "\<exists>m \<le> M. \<forall>n \<le> M. \<bar>(X::nat=> real) n\<bar> \<le> \<bar>X m\<bar>"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   756
apply (induct M)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   757
apply (rule_tac x = 0 in exI, simp, safe)
15236
f289e8ba2bb3 Proofs needed to be updated because induction now preserves name of
nipkow
parents: 15229
diff changeset
   758
apply (cut_tac x = "\<bar>X (Suc M)\<bar>" and y = "\<bar>X m\<bar> " in linorder_less_linear)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   759
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   760
apply (rule_tac x = m in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   761
apply (rule_tac [2] x = m in exI)
15236
f289e8ba2bb3 Proofs needed to be updated because induction now preserves name of
nipkow
parents: 15229
diff changeset
   762
apply (rule_tac [3] x = "Suc M" in exI, simp_all, safe)
f289e8ba2bb3 Proofs needed to be updated because induction now preserves name of
nipkow
parents: 15229
diff changeset
   763
apply (erule_tac [!] m1 = n in le_imp_less_or_eq [THEN disjE]) 
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   764
apply (simp_all add: less_Suc_cancel_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   765
apply (blast intro: order_le_less_trans [THEN order_less_imp_le])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   766
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   767
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   768
lemma lemma_Nat_covered:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   769
     "[| \<forall>m::nat. m \<le> M --> P M m;
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   770
         \<forall>m \<ge> M. P M m |]
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   771
      ==> \<forall>m. P M m"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   772
by (auto elim: less_asym simp add: le_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   773
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   774
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   775
lemma lemma_trans1:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   776
     "[| \<forall>n \<le> M. \<bar>(X::nat=>real) n\<bar> \<le> a;  a < b |]
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   777
      ==> \<forall>n \<le> M. \<bar>X n\<bar> \<le> b"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   778
by (blast intro: order_le_less_trans [THEN order_less_imp_le])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   779
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   780
lemma lemma_trans2:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   781
     "[| \<forall>n \<ge> M. \<bar>(X::nat=>real) n\<bar> < a; a < b |]
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   782
      ==> \<forall>n \<ge> M. \<bar>X n\<bar>\<le> b"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   783
by (blast intro: order_less_trans [THEN order_less_imp_le])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   784
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   785
lemma lemma_trans3:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   786
     "[| \<forall>n \<le> M. \<bar>X n\<bar> \<le> a; a = b |]
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   787
      ==> \<forall>n \<le> M. \<bar>X n\<bar> \<le> b"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   788
by auto
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   789
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   790
lemma lemma_trans4: "\<forall>n \<ge> M. \<bar>(X::nat=>real) n\<bar> < a
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   791
              ==>  \<forall>n \<ge> M. \<bar>X n\<bar> \<le> a"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   792
by (blast intro: order_less_imp_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   793
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   794
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   795
text{*Proof is more involved than outlines sketched by various authors
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   796
 would suggest*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   797
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   798
lemma Cauchy_Bseq: "Cauchy X ==> Bseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   799
apply (simp add: Cauchy_def Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   800
apply (drule_tac x = 1 in spec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   801
apply (erule zero_less_one [THEN [2] impE], safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   802
apply (drule_tac x = M in spec, simp)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   803
apply (drule lemmaCauchy)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   804
apply (cut_tac M = M and X = X in SUP_rabs_subseq, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   805
apply (cut_tac x = "\<bar>X m\<bar> " and y = "1 + \<bar>X M\<bar> " in linorder_less_linear)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   806
apply safe
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   807
apply (drule lemma_trans1, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   808
apply (drule_tac [3] lemma_trans2, erule_tac [3] asm_rl)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   809
apply (drule_tac [2] lemma_trans3, erule_tac [2] asm_rl)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   810
apply (drule_tac [3] abs_add_one_gt_zero [THEN order_less_trans])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   811
apply (drule lemma_trans4)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   812
apply (drule_tac [2] lemma_trans4)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   813
apply (rule_tac x = "1 + \<bar>X M\<bar> " in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   814
apply (rule_tac [2] x = "1 + \<bar>X M\<bar> " in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   815
apply (rule_tac [3] x = "\<bar>X m\<bar> " in exI)
15085
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15082
diff changeset
   816
apply (auto elim!: lemma_Nat_covered)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   817
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   818
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   819
text{*A Cauchy sequence is bounded -- nonstandard version*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   820
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   821
lemma NSCauchy_NSBseq: "NSCauchy X ==> NSBseq X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   822
by (simp add: Cauchy_Bseq Bseq_NSBseq_iff [symmetric] NSCauchy_Cauchy_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   823
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   824
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   825
text{*Equivalence of Cauchy criterion and convergence:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   826
  We will prove this using our NS formulation which provides a
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   827
  much easier proof than using the standard definition. We do not
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   828
  need to use properties of subsequences such as boundedness,
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   829
  monotonicity etc... Compare with Harrison's corresponding proof
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   830
  in HOL which is much longer and more complicated. Of course, we do
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   831
  not have problems which he encountered with guessing the right
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   832
  instantiations for his 'espsilon-delta' proof(s) in this case
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   833
  since the NS formulations do not involve existential quantifiers.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   834
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   835
lemma NSCauchy_NSconvergent_iff: "NSCauchy X = NSconvergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   836
apply (simp add: NSconvergent_def NSLIMSEQ_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   837
apply (frule NSCauchy_NSBseq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   838
apply (auto intro: approx_trans2 simp add: NSBseq_def NSCauchy_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   839
apply (drule HNatInfinite_whn [THEN [2] bspec])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   840
apply (drule HNatInfinite_whn [THEN [2] bspec])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   841
apply (auto dest!: st_part_Ex simp add: SReal_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   842
apply (blast intro: approx_trans3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   843
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   844
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   845
text{*Standard proof for free*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   846
lemma Cauchy_convergent_iff: "Cauchy X = convergent X"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   847
by (simp add: NSCauchy_Cauchy_iff [symmetric] convergent_NSconvergent_iff NSCauchy_NSconvergent_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   848
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   849
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   850
text{*We can now try and derive a few properties of sequences,
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   851
     starting with the limit comparison property for sequences.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   852
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   853
lemma NSLIMSEQ_le:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   854
       "[| f ----NS> l; g ----NS> m;
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   855
           \<exists>N. \<forall>n \<ge> N. f(n) \<le> g(n)
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   856
        |] ==> l \<le> m"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   857
apply (simp add: NSLIMSEQ_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   858
apply (drule starfun_le_mono)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   859
apply (drule HNatInfinite_whn [THEN [2] bspec])+
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   860
apply (drule_tac x = whn in spec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   861
apply (drule bex_Infinitesimal_iff2 [THEN iffD2])+
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   862
apply clarify
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   863
apply (auto intro: hypreal_of_real_le_add_Infininitesimal_cancel2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   864
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   865
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   866
(* standard version *)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   867
lemma LIMSEQ_le:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   868
     "[| f ----> l; g ----> m; \<exists>N. \<forall>n \<ge> N. f(n) \<le> g(n) |]
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   869
      ==> l \<le> m"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   870
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   871
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   872
lemma LIMSEQ_le_const: "[| X ----> r; \<forall>n. a \<le> X n |] ==> a \<le> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   873
apply (rule LIMSEQ_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   874
apply (rule LIMSEQ_const, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   875
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   876
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   877
lemma NSLIMSEQ_le_const: "[| X ----NS> r; \<forall>n. a \<le> X n |] ==> a \<le> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   878
by (simp add: LIMSEQ_NSLIMSEQ_iff LIMSEQ_le_const)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   879
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   880
lemma LIMSEQ_le_const2: "[| X ----> r; \<forall>n. X n \<le> a |] ==> r \<le> a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   881
apply (rule LIMSEQ_le)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   882
apply (rule_tac [2] LIMSEQ_const, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   883
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   884
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   885
lemma NSLIMSEQ_le_const2: "[| X ----NS> r; \<forall>n. X n \<le> a |] ==> r \<le> a"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   886
by (simp add: LIMSEQ_NSLIMSEQ_iff LIMSEQ_le_const2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   887
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   888
text{*Shift a convergent series by 1:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   889
  By the equivalence between Cauchiness and convergence and because
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   890
  the successor of an infinite hypernatural is also infinite.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   891
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   892
lemma NSLIMSEQ_Suc: "f ----NS> l ==> (%n. f(Suc n)) ----NS> l"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   893
apply (frule NSconvergentI [THEN NSCauchy_NSconvergent_iff [THEN iffD2]])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   894
apply (auto simp add: NSCauchy_def NSLIMSEQ_def starfunNat_shift_one)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   895
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   896
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   897
apply (drule Nats_1 [THEN [2] HNatInfinite_SHNat_add])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   898
apply (blast intro: approx_trans3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   899
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   900
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   901
text{* standard version *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   902
lemma LIMSEQ_Suc: "f ----> l ==> (%n. f(Suc n)) ----> l"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   903
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   904
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   905
lemma NSLIMSEQ_imp_Suc: "(%n. f(Suc n)) ----NS> l ==> f ----NS> l"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   906
apply (frule NSconvergentI [THEN NSCauchy_NSconvergent_iff [THEN iffD2]])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   907
apply (auto simp add: NSCauchy_def NSLIMSEQ_def starfunNat_shift_one)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   908
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   909
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   910
apply (frule Nats_1 [THEN [2] HNatInfinite_SHNat_diff])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   911
apply (drule_tac x="N - 1" in bspec) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   912
apply (auto intro: approx_trans3)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   913
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   914
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   915
lemma LIMSEQ_imp_Suc: "(%n. f(Suc n)) ----> l ==> f ----> l"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   916
apply (simp add: LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   917
apply (erule NSLIMSEQ_imp_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   918
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   919
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   920
lemma LIMSEQ_Suc_iff: "((%n. f(Suc n)) ----> l) = (f ----> l)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   921
by (blast intro: LIMSEQ_imp_Suc LIMSEQ_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   922
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   923
lemma NSLIMSEQ_Suc_iff: "((%n. f(Suc n)) ----NS> l) = (f ----NS> l)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   924
by (blast intro: NSLIMSEQ_imp_Suc NSLIMSEQ_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   925
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   926
text{*A sequence tends to zero iff its abs does*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   927
lemma LIMSEQ_rabs_zero: "((%n. \<bar>f n\<bar>) ----> 0) = (f ----> 0)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   928
by (simp add: LIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   929
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   930
text{*We prove the NS version from the standard one, since the NS proof
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   931
   seems more complicated than the standard one above!*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   932
lemma NSLIMSEQ_rabs_zero: "((%n. \<bar>f n\<bar>) ----NS> 0) = (f ----NS> 0)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   933
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_rabs_zero)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   934
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   935
text{*Generalization to other limits*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   936
lemma NSLIMSEQ_imp_rabs: "f ----NS> l ==> (%n. \<bar>f n\<bar>) ----NS> \<bar>l\<bar>"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   937
apply (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   938
apply (auto intro: approx_hrabs 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   939
            simp add: starfunNat_rabs hypreal_of_real_hrabs [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   940
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   941
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   942
text{* standard version *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   943
lemma LIMSEQ_imp_rabs: "f ----> l ==> (%n. \<bar>f n\<bar>) ----> \<bar>l\<bar>"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   944
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_imp_rabs)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   945
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   946
text{*An unbounded sequence's inverse tends to 0*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   947
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   948
text{* standard proof seems easier *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   949
lemma LIMSEQ_inverse_zero:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   950
      "\<forall>y. \<exists>N. \<forall>n \<ge> N. y < f(n) ==> (%n. inverse(f n)) ----> 0"
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   951
apply (simp add: LIMSEQ_def, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   952
apply (drule_tac x = "inverse r" in spec, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   953
apply (rule_tac x = N in exI, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   954
apply (drule spec, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   955
apply (frule positive_imp_inverse_positive)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   956
apply (frule order_less_trans, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   957
apply (frule_tac a = "f n" in positive_imp_inverse_positive)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   958
apply (simp add: abs_if) 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   959
apply (rule_tac t = r in inverse_inverse_eq [THEN subst])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   960
apply (auto intro: inverse_less_iff_less [THEN iffD2]
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   961
            simp del: inverse_inverse_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   962
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   963
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   964
lemma NSLIMSEQ_inverse_zero:
15360
300e09825d8b Added "ALL x > y" and relatives.
nipkow
parents: 15312
diff changeset
   965
     "\<forall>y. \<exists>N. \<forall>n \<ge> N. y < f(n)
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   966
      ==> (%n. inverse(f n)) ----NS> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   967
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_zero)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   968
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   969
text{*The sequence @{term "1/n"} tends to 0 as @{term n} tends to infinity*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   970
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   971
lemma LIMSEQ_inverse_real_of_nat: "(%n. inverse(real(Suc n))) ----> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   972
apply (rule LIMSEQ_inverse_zero, safe)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   973
apply (cut_tac x = y in reals_Archimedean2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   974
apply (safe, rule_tac x = n in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   975
apply (auto simp add: real_of_nat_Suc)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   976
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   977
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   978
lemma NSLIMSEQ_inverse_real_of_nat: "(%n. inverse(real(Suc n))) ----NS> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   979
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   980
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   981
text{*The sequence @{term "r + 1/n"} tends to @{term r} as @{term n} tends to
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   982
infinity is now easily proved*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   983
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   984
lemma LIMSEQ_inverse_real_of_nat_add:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   985
     "(%n. r + inverse(real(Suc n))) ----> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   986
by (cut_tac LIMSEQ_add [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat], auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   987
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   988
lemma NSLIMSEQ_inverse_real_of_nat_add:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   989
     "(%n. r + inverse(real(Suc n))) ----NS> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   990
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   991
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   992
lemma LIMSEQ_inverse_real_of_nat_add_minus:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   993
     "(%n. r + -inverse(real(Suc n))) ----> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   994
by (cut_tac LIMSEQ_add_minus [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat], auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   995
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   996
lemma NSLIMSEQ_inverse_real_of_nat_add_minus:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   997
     "(%n. r + -inverse(real(Suc n))) ----NS> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   998
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add_minus)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
   999
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1000
lemma LIMSEQ_inverse_real_of_nat_add_minus_mult:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1001
     "(%n. r*( 1 + -inverse(real(Suc n)))) ----> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1002
by (cut_tac b=1 in
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1003
        LIMSEQ_mult [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat_add_minus], auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1004
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1005
lemma NSLIMSEQ_inverse_real_of_nat_add_minus_mult:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1006
     "(%n. r*( 1 + -inverse(real(Suc n)))) ----NS> r"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1007
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add_minus_mult)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1008
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1009
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1010
text{* Real Powers*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1011
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1012
lemma NSLIMSEQ_pow [rule_format]:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1013
     "(X ----NS> a) --> ((%n. (X n) ^ m) ----NS> a ^ m)"
15251
bb6f072c8d10 converted some induct_tac to induct
paulson
parents: 15241
diff changeset
  1014
apply (induct "m")
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1015
apply (auto intro: NSLIMSEQ_mult NSLIMSEQ_const)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1016
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1017
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1018
lemma LIMSEQ_pow: "X ----> a ==> (%n. (X n) ^ m) ----> a ^ m"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1019
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_pow)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1020
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1021
text{*The sequence @{term "x^n"} tends to 0 if @{term "0\<le>x"} and @{term
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1022
"x<1"}.  Proof will use (NS) Cauchy equivalence for convergence and
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1023
  also fact that bounded and monotonic sequence converges.*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1024
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1025
lemma Bseq_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> Bseq (%n. x ^ n)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1026
apply (simp add: Bseq_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1027
apply (rule_tac x = 1 in exI)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1028
apply (simp add: power_abs)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1029
apply (auto dest: power_mono intro: order_less_imp_le simp add: abs_if)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1030
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1031
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1032
lemma monoseq_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> monoseq (%n. x ^ n)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1033
apply (clarify intro!: mono_SucI2)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1034
apply (cut_tac n = n and N = "Suc n" and a = x in power_decreasing, auto)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1035
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1036
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1037
lemma convergent_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> convergent (%n. x ^ n)"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1038
by (blast intro!: Bseq_monoseq_convergent Bseq_realpow monoseq_realpow)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1039
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1040
text{* We now use NS criterion to bring proof of theorem through *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1041
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1042
lemma NSLIMSEQ_realpow_zero: "[| 0 \<le> x; x < 1 |] ==> (%n. x ^ n) ----NS> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1043
apply (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1044
apply (auto dest!: convergent_realpow simp add: convergent_NSconvergent_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1045
apply (frule NSconvergentD)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1046
apply (auto simp add: NSLIMSEQ_def NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_pow)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1047
apply (frule HNatInfinite_add_one)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1048
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1049
apply (drule bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1050
apply (drule_tac x = "N + (1::hypnat) " in bspec, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1051
apply (simp add: hyperpow_add)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1052
apply (drule approx_mult_subst_SReal, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1053
apply (drule approx_trans3, assumption)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1054
apply (auto simp del: hypreal_of_real_mult simp add: hypreal_of_real_mult [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1055
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1056
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1057
text{* standard version *}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1058
lemma LIMSEQ_realpow_zero: "[| 0 \<le> x; x < 1 |] ==> (%n. x ^ n) ----> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1059
by (simp add: NSLIMSEQ_realpow_zero LIMSEQ_NSLIMSEQ_iff)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1060
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1061
lemma LIMSEQ_divide_realpow_zero: "1 < x ==> (%n. a / (x ^ n)) ----> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1062
apply (cut_tac a = a and x1 = "inverse x" in
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1063
        LIMSEQ_mult [OF LIMSEQ_const LIMSEQ_realpow_zero])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1064
apply (auto simp add: divide_inverse power_inverse)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1065
apply (simp add: inverse_eq_divide pos_divide_less_eq)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1066
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1067
15102
04b0e943fcc9 new simprules Int_subset_iff and Un_subset_iff
paulson
parents: 15085
diff changeset
  1068
text{*Limit of @{term "c^n"} for @{term"\<bar>c\<bar> < 1"}*}
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1069
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1070
lemma LIMSEQ_rabs_realpow_zero: "\<bar>c\<bar> < 1 ==> (%n. \<bar>c\<bar> ^ n) ----> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1071
by (blast intro!: LIMSEQ_realpow_zero abs_ge_zero)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1072
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1073
lemma NSLIMSEQ_rabs_realpow_zero: "\<bar>c\<bar> < 1 ==> (%n. \<bar>c\<bar> ^ n) ----NS> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1074
by (simp add: LIMSEQ_rabs_realpow_zero LIMSEQ_NSLIMSEQ_iff [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1075
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1076
lemma LIMSEQ_rabs_realpow_zero2: "\<bar>c\<bar> < 1 ==> (%n. c ^ n) ----> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1077
apply (rule LIMSEQ_rabs_zero [THEN iffD1])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1078
apply (auto intro: LIMSEQ_rabs_realpow_zero simp add: power_abs)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1079
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1080
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1081
lemma NSLIMSEQ_rabs_realpow_zero2: "\<bar>c\<bar> < 1 ==> (%n. c ^ n) ----NS> 0"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1082
by (simp add: LIMSEQ_rabs_realpow_zero2 LIMSEQ_NSLIMSEQ_iff [symmetric])
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1083
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1084
subsection{*Hyperreals and Sequences*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1085
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1086
text{*A bounded sequence is a finite hyperreal*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1087
lemma NSBseq_HFinite_hypreal: "NSBseq X ==> Abs_hypreal(hyprel``{X}) : HFinite"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1088
by (auto intro!: bexI lemma_hyprel_refl 
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1089
            intro: FreeUltrafilterNat_all [THEN FreeUltrafilterNat_subset]
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1090
            simp add: HFinite_FreeUltrafilterNat_iff Bseq_NSBseq_iff [symmetric]
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1091
                      Bseq_iff1a)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1092
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1093
text{*A sequence converging to zero defines an infinitesimal*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1094
lemma NSLIMSEQ_zero_Infinitesimal_hypreal:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1095
      "X ----NS> 0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1096
apply (simp add: NSLIMSEQ_def)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1097
apply (drule_tac x = whn in bspec)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1098
apply (simp add: HNatInfinite_whn)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1099
apply (auto simp add: hypnat_omega_def mem_infmal_iff [symmetric] starfunNat)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1100
done
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1101
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1102
(***---------------------------------------------------------------
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1103
    Theorems proved by Harrison in HOL that we do not need
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1104
    in order to prove equivalence between Cauchy criterion
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1105
    and convergence:
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1106
 -- Show that every sequence contains a monotonic subsequence
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1107
Goal "\<exists>f. subseq f & monoseq (%n. s (f n))"
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1108
 -- Show that a subsequence of a bounded sequence is bounded
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1109
Goal "Bseq X ==> Bseq (%n. X (f n))";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1110
 -- Show we can take subsequential terms arbitrarily far
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1111
    up a sequence
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1112
Goal "subseq f ==> n \<le> f(n)";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1113
Goal "subseq f ==> \<exists>n. N1 \<le> n & N2 \<le> f(n)";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1114
 ---------------------------------------------------------------***)
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1115
15241
a3949068537e tweaks concerned with poly bug-fixing
paulson
parents: 15236
diff changeset
  1116
15082
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1117
ML
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1118
{*
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1119
val Cauchy_def = thm"Cauchy_def";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1120
val SEQ_Infinitesimal = thm "SEQ_Infinitesimal";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1121
val LIMSEQ_iff = thm "LIMSEQ_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1122
val NSLIMSEQ_iff = thm "NSLIMSEQ_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1123
val LIMSEQ_NSLIMSEQ = thm "LIMSEQ_NSLIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1124
val NSLIMSEQ_finite_set = thm "NSLIMSEQ_finite_set";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1125
val Compl_less_set = thm "Compl_less_set";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1126
val FreeUltrafilterNat_NSLIMSEQ = thm "FreeUltrafilterNat_NSLIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1127
val HNatInfinite_NSLIMSEQ = thm "HNatInfinite_NSLIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1128
val NSLIMSEQ_LIMSEQ = thm "NSLIMSEQ_LIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1129
val LIMSEQ_NSLIMSEQ_iff = thm "LIMSEQ_NSLIMSEQ_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1130
val NSLIMSEQ_const = thm "NSLIMSEQ_const";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1131
val LIMSEQ_const = thm "LIMSEQ_const";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1132
val NSLIMSEQ_add = thm "NSLIMSEQ_add";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1133
val LIMSEQ_add = thm "LIMSEQ_add";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1134
val NSLIMSEQ_mult = thm "NSLIMSEQ_mult";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1135
val LIMSEQ_mult = thm "LIMSEQ_mult";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1136
val NSLIMSEQ_minus = thm "NSLIMSEQ_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1137
val LIMSEQ_minus = thm "LIMSEQ_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1138
val LIMSEQ_minus_cancel = thm "LIMSEQ_minus_cancel";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1139
val NSLIMSEQ_minus_cancel = thm "NSLIMSEQ_minus_cancel";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1140
val NSLIMSEQ_add_minus = thm "NSLIMSEQ_add_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1141
val LIMSEQ_add_minus = thm "LIMSEQ_add_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1142
val LIMSEQ_diff = thm "LIMSEQ_diff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1143
val NSLIMSEQ_diff = thm "NSLIMSEQ_diff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1144
val NSLIMSEQ_inverse = thm "NSLIMSEQ_inverse";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1145
val LIMSEQ_inverse = thm "LIMSEQ_inverse";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1146
val NSLIMSEQ_mult_inverse = thm "NSLIMSEQ_mult_inverse";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1147
val LIMSEQ_divide = thm "LIMSEQ_divide";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1148
val NSLIMSEQ_unique = thm "NSLIMSEQ_unique";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1149
val LIMSEQ_unique = thm "LIMSEQ_unique";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1150
val limI = thm "limI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1151
val nslimI = thm "nslimI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1152
val lim_nslim_iff = thm "lim_nslim_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1153
val convergentD = thm "convergentD";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1154
val convergentI = thm "convergentI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1155
val NSconvergentD = thm "NSconvergentD";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1156
val NSconvergentI = thm "NSconvergentI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1157
val convergent_NSconvergent_iff = thm "convergent_NSconvergent_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1158
val NSconvergent_NSLIMSEQ_iff = thm "NSconvergent_NSLIMSEQ_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1159
val convergent_LIMSEQ_iff = thm "convergent_LIMSEQ_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1160
val subseq_Suc_iff = thm "subseq_Suc_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1161
val monoseq_Suc = thm "monoseq_Suc";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1162
val monoI1 = thm "monoI1";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1163
val monoI2 = thm "monoI2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1164
val mono_SucI1 = thm "mono_SucI1";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1165
val mono_SucI2 = thm "mono_SucI2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1166
val BseqD = thm "BseqD";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1167
val BseqI = thm "BseqI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1168
val Bseq_iff = thm "Bseq_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1169
val Bseq_iff1a = thm "Bseq_iff1a";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1170
val NSBseqD = thm "NSBseqD";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1171
val NSBseqI = thm "NSBseqI";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1172
val Bseq_NSBseq = thm "Bseq_NSBseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1173
val real_seq_to_hypreal_HInfinite = thm "real_seq_to_hypreal_HInfinite";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1174
val HNatInfinite_skolem_f = thm "HNatInfinite_skolem_f";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1175
val NSBseq_Bseq = thm "NSBseq_Bseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1176
val Bseq_NSBseq_iff = thm "Bseq_NSBseq_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1177
val NSconvergent_NSBseq = thm "NSconvergent_NSBseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1178
val convergent_Bseq = thm "convergent_Bseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1179
val Bseq_isUb = thm "Bseq_isUb";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1180
val Bseq_isLub = thm "Bseq_isLub";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1181
val NSBseq_isUb = thm "NSBseq_isUb";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1182
val NSBseq_isLub = thm "NSBseq_isLub";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1183
val Bmonoseq_LIMSEQ = thm "Bmonoseq_LIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1184
val Bmonoseq_NSLIMSEQ = thm "Bmonoseq_NSLIMSEQ";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1185
val Bseq_mono_convergent = thm "Bseq_mono_convergent";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1186
val NSBseq_mono_NSconvergent = thm "NSBseq_mono_NSconvergent";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1187
val convergent_minus_iff = thm "convergent_minus_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1188
val Bseq_minus_iff = thm "Bseq_minus_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1189
val Bseq_monoseq_convergent = thm "Bseq_monoseq_convergent";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1190
val Bseq_iff2 = thm "Bseq_iff2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1191
val Bseq_iff3 = thm "Bseq_iff3";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1192
val BseqI2 = thm "BseqI2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1193
val Cauchy_NSCauchy = thm "Cauchy_NSCauchy";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1194
val NSCauchy_Cauchy = thm "NSCauchy_Cauchy";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1195
val NSCauchy_Cauchy_iff = thm "NSCauchy_Cauchy_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1196
val less_Suc_cancel_iff = thm "less_Suc_cancel_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1197
val SUP_rabs_subseq = thm "SUP_rabs_subseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1198
val Cauchy_Bseq = thm "Cauchy_Bseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1199
val NSCauchy_NSBseq = thm "NSCauchy_NSBseq";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1200
val NSCauchy_NSconvergent_iff = thm "NSCauchy_NSconvergent_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1201
val Cauchy_convergent_iff = thm "Cauchy_convergent_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1202
val NSLIMSEQ_le = thm "NSLIMSEQ_le";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1203
val LIMSEQ_le = thm "LIMSEQ_le";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1204
val LIMSEQ_le_const = thm "LIMSEQ_le_const";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1205
val NSLIMSEQ_le_const = thm "NSLIMSEQ_le_const";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1206
val LIMSEQ_le_const2 = thm "LIMSEQ_le_const2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1207
val NSLIMSEQ_le_const2 = thm "NSLIMSEQ_le_const2";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1208
val NSLIMSEQ_Suc = thm "NSLIMSEQ_Suc";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1209
val LIMSEQ_Suc = thm "LIMSEQ_Suc";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1210
val NSLIMSEQ_imp_Suc = thm "NSLIMSEQ_imp_Suc";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1211
val LIMSEQ_imp_Suc = thm "LIMSEQ_imp_Suc";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1212
val LIMSEQ_Suc_iff = thm "LIMSEQ_Suc_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1213
val NSLIMSEQ_Suc_iff = thm "NSLIMSEQ_Suc_iff";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1214
val LIMSEQ_rabs_zero = thm "LIMSEQ_rabs_zero";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1215
val NSLIMSEQ_rabs_zero = thm "NSLIMSEQ_rabs_zero";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1216
val NSLIMSEQ_imp_rabs = thm "NSLIMSEQ_imp_rabs";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1217
val LIMSEQ_imp_rabs = thm "LIMSEQ_imp_rabs";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1218
val LIMSEQ_inverse_zero = thm "LIMSEQ_inverse_zero";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1219
val NSLIMSEQ_inverse_zero = thm "NSLIMSEQ_inverse_zero";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1220
val LIMSEQ_inverse_real_of_nat = thm "LIMSEQ_inverse_real_of_nat";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1221
val NSLIMSEQ_inverse_real_of_nat = thm "NSLIMSEQ_inverse_real_of_nat";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1222
val LIMSEQ_inverse_real_of_nat_add = thm "LIMSEQ_inverse_real_of_nat_add";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1223
val NSLIMSEQ_inverse_real_of_nat_add = thm "NSLIMSEQ_inverse_real_of_nat_add";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1224
val LIMSEQ_inverse_real_of_nat_add_minus = thm "LIMSEQ_inverse_real_of_nat_add_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1225
val NSLIMSEQ_inverse_real_of_nat_add_minus = thm "NSLIMSEQ_inverse_real_of_nat_add_minus";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1226
val LIMSEQ_inverse_real_of_nat_add_minus_mult = thm "LIMSEQ_inverse_real_of_nat_add_minus_mult";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1227
val NSLIMSEQ_inverse_real_of_nat_add_minus_mult = thm "NSLIMSEQ_inverse_real_of_nat_add_minus_mult";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1228
val NSLIMSEQ_pow = thm "NSLIMSEQ_pow";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1229
val LIMSEQ_pow = thm "LIMSEQ_pow";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1230
val Bseq_realpow = thm "Bseq_realpow";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1231
val monoseq_realpow = thm "monoseq_realpow";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1232
val convergent_realpow = thm "convergent_realpow";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1233
val NSLIMSEQ_realpow_zero = thm "NSLIMSEQ_realpow_zero";
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1234
*}
6c3276a2735b conversion of SEQ.ML to Isar script
paulson
parents: 13810
diff changeset
  1235
15241
a3949068537e tweaks concerned with poly bug-fixing
paulson
parents: 15236
diff changeset
  1236
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
  1237
end