src/HOL/Nonstandard_Analysis/HLim.thy
author wenzelm
Wed, 17 May 2017 13:47:19 +0200
changeset 65851 c103358a5559
parent 64604 2bf8cfc98c4d
child 66827 c94531b5007d
permissions -rw-r--r--
tuned signature;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62479
716336f19aa9 clarified session;
wenzelm
parents: 61982
diff changeset
     1
(*  Title:      HOL/Nonstandard_Analysis/HLim.thy
41589
bbd861837ebc tuned headers;
wenzelm
parents: 37887
diff changeset
     2
    Author:     Jacques D. Fleuriot, University of Cambridge
bbd861837ebc tuned headers;
wenzelm
parents: 37887
diff changeset
     3
    Author:     Lawrence C Paulson
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     4
*)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     5
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
     6
section \<open>Limits and Continuity (Nonstandard)\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     7
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     8
theory HLim
63579
73939a9b70a3 support 'abbrevs' within theory header;
wenzelm
parents: 63040
diff changeset
     9
  imports Star
73939a9b70a3 support 'abbrevs' within theory header;
wenzelm
parents: 63040
diff changeset
    10
  abbrevs "--->" = "\<midarrow>\<rightarrow>\<^sub>N\<^sub>S"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    11
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    12
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    13
text \<open>Nonstandard Definitions.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    14
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    15
definition NSLIM :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    16
    ("((_)/ \<midarrow>(_)/\<rightarrow>\<^sub>N\<^sub>S (_))" [60, 0, 60] 60)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    17
  where "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<longleftrightarrow> (\<forall>x. x \<noteq> star_of a \<and> x \<approx> star_of a \<longrightarrow> ( *f* f) x \<approx> star_of L)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    18
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    19
definition isNSCont :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> bool"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    20
  where  \<comment> \<open>NS definition dispenses with limit notions\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    21
    "isNSCont f a \<longleftrightarrow> (\<forall>y. y \<approx> star_of a \<longrightarrow> ( *f* f) y \<approx> star_of (f a))"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    22
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    23
definition isNSUCont :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> bool"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    24
  where "isNSUCont f \<longleftrightarrow> (\<forall>x y. x \<approx> y \<longrightarrow> ( *f* f) x \<approx> ( *f* f) y)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    25
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    26
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61971
diff changeset
    27
subsection \<open>Limits of Functions\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    28
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    29
lemma NSLIM_I: "(\<And>x. x \<noteq> star_of a \<Longrightarrow> x \<approx> star_of a \<Longrightarrow> starfun f x \<approx> star_of L) \<Longrightarrow> f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    30
  by (simp add: NSLIM_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    31
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    32
lemma NSLIM_D: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> x \<noteq> star_of a \<Longrightarrow> x \<approx> star_of a \<Longrightarrow> starfun f x \<approx> star_of L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    33
  by (simp add: NSLIM_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    34
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    35
text \<open>Proving properties of limits using nonstandard definition.
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    36
  The properties hold for standard limits as well!\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    37
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    38
lemma NSLIM_mult: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S m \<Longrightarrow> (\<lambda>x. f x * g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (l * m)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    39
  for l m :: "'a::real_normed_algebra"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    40
  by (auto simp add: NSLIM_def intro!: approx_mult_HFinite)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    41
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    42
lemma starfun_scaleR [simp]: "starfun (\<lambda>x. f x *\<^sub>R g x) = (\<lambda>x. scaleHR (starfun f x) (starfun g x))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    43
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    44
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    45
lemma NSLIM_scaleR: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S m \<Longrightarrow> (\<lambda>x. f x *\<^sub>R g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (l *\<^sub>R m)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    46
  by (auto simp add: NSLIM_def intro!: approx_scaleR_HFinite)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    47
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    48
lemma NSLIM_add: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S m \<Longrightarrow> (\<lambda>x. f x + g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (l + m)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    49
  by (auto simp add: NSLIM_def intro!: approx_add)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    50
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    51
lemma NSLIM_const [simp]: "(\<lambda>x. k) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S k"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    52
  by (simp add: NSLIM_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    53
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    54
lemma NSLIM_minus: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> (\<lambda>x. - f x) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S -L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    55
  by (simp add: NSLIM_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    56
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    57
lemma NSLIM_diff: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S m \<Longrightarrow> (\<lambda>x. f x - g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (l - m)"
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 51525
diff changeset
    58
  by (simp only: NSLIM_add NSLIM_minus diff_conv_add_uminus)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    59
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    60
lemma NSLIM_add_minus: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S m \<Longrightarrow> (\<lambda>x. f x + - g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S (l + -m)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    61
  by (simp only: NSLIM_add NSLIM_minus)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    62
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    63
lemma NSLIM_inverse: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> L \<noteq> 0 \<Longrightarrow> (\<lambda>x. inverse (f x)) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (inverse L)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    64
  for L :: "'a::real_normed_div_algebra"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    65
  apply (simp add: NSLIM_def, clarify)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    66
  apply (drule spec)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    67
  apply (auto simp add: star_of_approx_inverse)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    68
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    69
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    70
lemma NSLIM_zero:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    71
  assumes f: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    72
  shows "(\<lambda>x. f(x) - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S 0"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    73
proof -
61971
720fa884656e more symbols;
wenzelm
parents: 58878
diff changeset
    74
  have "(\<lambda>x. f x - l) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S l - l"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    75
    by (rule NSLIM_diff [OF f NSLIM_const])
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    76
  then show ?thesis by simp
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    77
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    78
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    79
lemma NSLIM_zero_cancel: "(\<lambda>x. f x - l) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0 \<Longrightarrow> f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S l"
64604
2bf8cfc98c4d misc tuning and modernization;
wenzelm
parents: 64435
diff changeset
    80
  apply (drule_tac g = "\<lambda>x. l" and m = l in NSLIM_add)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    81
   apply (auto simp add: add.assoc)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    82
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    83
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    84
lemma NSLIM_const_not_eq: "k \<noteq> L \<Longrightarrow> \<not> (\<lambda>x. k) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    85
  for a :: "'a::real_normed_algebra_1"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    86
  apply (simp add: NSLIM_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    87
  apply (rule_tac x="star_of a + of_hypreal \<epsilon>" in exI)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    88
  apply (simp add: hypreal_epsilon_not_zero approx_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    89
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    90
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    91
lemma NSLIM_not_zero: "k \<noteq> 0 \<Longrightarrow> \<not> (\<lambda>x. k) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S 0"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    92
  for a :: "'a::real_normed_algebra_1"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    93
  by (rule NSLIM_const_not_eq)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    94
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    95
lemma NSLIM_const_eq: "(\<lambda>x. k) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> k = L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    96
  for a :: "'a::real_normed_algebra_1"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    97
  by (rule ccontr) (blast dest: NSLIM_const_not_eq)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    98
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
    99
lemma NSLIM_unique: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S M \<Longrightarrow> L = M"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   100
  for a :: "'a::real_normed_algebra_1"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   101
  by (drule (1) NSLIM_diff) (auto dest!: NSLIM_const_eq)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   102
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   103
lemma NSLIM_mult_zero: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0 \<Longrightarrow> g \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0 \<Longrightarrow> (\<lambda>x. f x * g x) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   104
  for f g :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   105
  by (drule NSLIM_mult) auto
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   106
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   107
lemma NSLIM_self: "(\<lambda>x. x) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   108
  by (simp add: NSLIM_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   109
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   110
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61971
diff changeset
   111
subsubsection \<open>Equivalence of @{term filterlim} and @{term NSLIM}\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   112
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   113
lemma LIM_NSLIM:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   114
  assumes f: "f \<midarrow>a\<rightarrow> L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   115
  shows "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   116
proof (rule NSLIM_I)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   117
  fix x
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   118
  assume neq: "x \<noteq> star_of a"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   119
  assume approx: "x \<approx> star_of a"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   120
  have "starfun f x - star_of L \<in> Infinitesimal"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   121
  proof (rule InfinitesimalI2)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   122
    fix r :: real
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   123
    assume r: "0 < r"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   124
    from LIM_D [OF f r] obtain s
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   125
      where s: "0 < s" and less_r: "\<And>x. x \<noteq> a \<Longrightarrow> norm (x - a) < s \<Longrightarrow> norm (f x - L) < r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   126
      by fast
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   127
    from less_r have less_r':
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   128
      "\<And>x. x \<noteq> star_of a \<Longrightarrow> hnorm (x - star_of a) < star_of s \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   129
        hnorm (starfun f x - star_of L) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   130
      by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   131
    from approx have "x - star_of a \<in> Infinitesimal"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   132
      by (simp only: approx_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   133
    then have "hnorm (x - star_of a) < star_of s"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   134
      using s by (rule InfinitesimalD2)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   135
    with neq show "hnorm (starfun f x - star_of L) < star_of r"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   136
      by (rule less_r')
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   137
  qed
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   138
  then show "starfun f x \<approx> star_of L"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   139
    by (unfold approx_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   140
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   141
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   142
lemma NSLIM_LIM:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   143
  assumes f: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   144
  shows "f \<midarrow>a\<rightarrow> L"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   145
proof (rule LIM_I)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   146
  fix r :: real
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   147
  assume r: "0 < r"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   148
  have "\<exists>s>0. \<forall>x. x \<noteq> star_of a \<and> hnorm (x - star_of a) < s \<longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   149
    hnorm (starfun f x - star_of L) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   150
  proof (rule exI, safe)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   151
    show "0 < \<epsilon>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   152
      by (rule hypreal_epsilon_gt_zero)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   153
  next
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   154
    fix x
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   155
    assume neq: "x \<noteq> star_of a"
61981
1b5845c62fa0 more symbols;
wenzelm
parents: 61976
diff changeset
   156
    assume "hnorm (x - star_of a) < \<epsilon>"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   157
    with Infinitesimal_epsilon have "x - star_of a \<in> Infinitesimal"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   158
      by (rule hnorm_less_Infinitesimal)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   159
    then have "x \<approx> star_of a"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   160
      by (unfold approx_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   161
    with f neq have "starfun f x \<approx> star_of L"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   162
      by (rule NSLIM_D)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   163
    then have "starfun f x - star_of L \<in> Infinitesimal"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   164
      by (unfold approx_def)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   165
    then show "hnorm (starfun f x - star_of L) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   166
      using r by (rule InfinitesimalD2)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   167
  qed
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   168
  then show "\<exists>s>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < s \<longrightarrow> norm (f x - L) < r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   169
    by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   170
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   171
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   172
theorem LIM_NSLIM_iff: "f \<midarrow>x\<rightarrow> L \<longleftrightarrow> f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   173
  by (blast intro: LIM_NSLIM NSLIM_LIM)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   174
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   175
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61971
diff changeset
   176
subsection \<open>Continuity\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   177
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   178
lemma isNSContD: "isNSCont f a \<Longrightarrow> y \<approx> star_of a \<Longrightarrow> ( *f* f) y \<approx> star_of (f a)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   179
  by (simp add: isNSCont_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   180
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   181
lemma isNSCont_NSLIM: "isNSCont f a \<Longrightarrow> f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (f a)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   182
  by (simp add: isNSCont_def NSLIM_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   183
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   184
lemma NSLIM_isNSCont: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (f a) \<Longrightarrow> isNSCont f a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   185
  apply (auto simp add: isNSCont_def NSLIM_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   186
  apply (case_tac "y = star_of a")
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   187
   apply auto
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   188
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   189
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   190
text \<open>NS continuity can be defined using NS Limit in
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   191
  similar fashion to standard definition of continuity.\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   192
lemma isNSCont_NSLIM_iff: "isNSCont f a \<longleftrightarrow> f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (f a)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   193
  by (blast intro: isNSCont_NSLIM NSLIM_isNSCont)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   194
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   195
text \<open>Hence, NS continuity can be given in terms of standard limit.\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   196
lemma isNSCont_LIM_iff: "(isNSCont f a) = (f \<midarrow>a\<rightarrow> (f a))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   197
  by (simp add: LIM_NSLIM_iff isNSCont_NSLIM_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   198
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   199
text \<open>Moreover, it's trivial now that NS continuity
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   200
  is equivalent to standard continuity.\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   201
lemma isNSCont_isCont_iff: "isNSCont f a \<longleftrightarrow> isCont f a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   202
  by (simp add: isCont_def) (rule isNSCont_LIM_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   203
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   204
text \<open>Standard continuity \<open>\<Longrightarrow>\<close> NS continuity.\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   205
lemma isCont_isNSCont: "isCont f a \<Longrightarrow> isNSCont f a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   206
  by (erule isNSCont_isCont_iff [THEN iffD2])
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   207
64604
2bf8cfc98c4d misc tuning and modernization;
wenzelm
parents: 64435
diff changeset
   208
text \<open>NS continuity \<open>\<Longrightarrow>\<close> Standard continuity.\<close>
2bf8cfc98c4d misc tuning and modernization;
wenzelm
parents: 64435
diff changeset
   209
lemma isNSCont_isCont: "isNSCont f a \<Longrightarrow> isCont f a"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   210
  by (erule isNSCont_isCont_iff [THEN iffD1])
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   211
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   212
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   213
text \<open>Alternative definition of continuity.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   214
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   215
text \<open>Prove equivalence between NS limits --
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   216
  seems easier than using standard definition.\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   217
lemma NSLIM_h_iff: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<longleftrightarrow> (\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow>\<^sub>N\<^sub>S L"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   218
  apply (simp add: NSLIM_def, auto)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   219
   apply (drule_tac x = "star_of a + x" in spec)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   220
   apply (drule_tac [2] x = "- star_of a + x" in spec, safe, simp)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   221
      apply (erule mem_infmal_iff [THEN iffD2, THEN Infinitesimal_add_approx_self [THEN approx_sym]])
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   222
     apply (erule_tac [3] approx_minus_iff2 [THEN iffD1])
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   223
    prefer 2 apply (simp add: add.commute)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   224
   apply (rule_tac x = x in star_cases)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   225
   apply (rule_tac [2] x = x in star_cases)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   226
   apply (auto simp add: starfun star_of_def star_n_minus star_n_add add.assoc star_n_zero_num)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   227
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   228
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   229
lemma NSLIM_isCont_iff: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S f a \<longleftrightarrow> (\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow>\<^sub>N\<^sub>S f a"
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 51525
diff changeset
   230
  by (fact NSLIM_h_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   231
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   232
lemma isNSCont_minus: "isNSCont f a \<Longrightarrow> isNSCont (\<lambda>x. - f x) a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   233
  by (simp add: isNSCont_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   234
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   235
lemma isNSCont_inverse: "isNSCont f x \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow> isNSCont (\<lambda>x. inverse (f x)) x"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   236
  for f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_div_algebra"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   237
  by (auto intro: isCont_inverse simp add: isNSCont_isCont_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   238
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   239
lemma isNSCont_const [simp]: "isNSCont (\<lambda>x. k) a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   240
  by (simp add: isNSCont_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   241
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   242
lemma isNSCont_abs [simp]: "isNSCont abs a"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   243
  for a :: real
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   244
  by (auto simp: isNSCont_def intro: approx_hrabs simp: starfun_rabs_hrabs)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   245
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   246
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61971
diff changeset
   247
subsection \<open>Uniform Continuity\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   248
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   249
lemma isNSUContD: "isNSUCont f \<Longrightarrow> x \<approx> y \<Longrightarrow> ( *f* f) x \<approx> ( *f* f) y"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   250
  by (simp add: isNSUCont_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   251
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   252
lemma isUCont_isNSUCont:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   253
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   254
  assumes f: "isUCont f"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   255
  shows "isNSUCont f"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   256
  unfolding isNSUCont_def
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   257
proof safe
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   258
  fix x y :: "'a star"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   259
  assume approx: "x \<approx> y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   260
  have "starfun f x - starfun f y \<in> Infinitesimal"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   261
  proof (rule InfinitesimalI2)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   262
    fix r :: real
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   263
    assume r: "0 < r"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   264
    with f obtain s where s: "0 < s"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   265
      and less_r: "\<And>x y. norm (x - y) < s \<Longrightarrow> norm (f x - f y) < r"
31338
d41a8ba25b67 generalize constants from Lim.thy to class metric_space
huffman
parents: 28562
diff changeset
   266
      by (auto simp add: isUCont_def dist_norm)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   267
    from less_r have less_r':
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   268
      "\<And>x y. hnorm (x - y) < star_of s \<Longrightarrow> hnorm (starfun f x - starfun f y) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   269
      by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   270
    from approx have "x - y \<in> Infinitesimal"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   271
      by (unfold approx_def)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   272
    then have "hnorm (x - y) < star_of s"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   273
      using s by (rule InfinitesimalD2)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   274
    then show "hnorm (starfun f x - starfun f y) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   275
      by (rule less_r')
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   276
  qed
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   277
  then show "starfun f x \<approx> starfun f y"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   278
    by (unfold approx_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   279
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   280
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   281
lemma isNSUCont_isUCont:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   282
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   283
  assumes f: "isNSUCont f"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   284
  shows "isUCont f"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   285
  unfolding isUCont_def dist_norm
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   286
proof safe
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   287
  fix r :: real
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   288
  assume r: "0 < r"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   289
  have "\<exists>s>0. \<forall>x y. hnorm (x - y) < s \<longrightarrow> hnorm (starfun f x - starfun f y) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   290
  proof (rule exI, safe)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   291
    show "0 < \<epsilon>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   292
      by (rule hypreal_epsilon_gt_zero)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   293
  next
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   294
    fix x y :: "'a star"
61981
1b5845c62fa0 more symbols;
wenzelm
parents: 61976
diff changeset
   295
    assume "hnorm (x - y) < \<epsilon>"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   296
    with Infinitesimal_epsilon have "x - y \<in> Infinitesimal"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   297
      by (rule hnorm_less_Infinitesimal)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   298
    then have "x \<approx> y"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   299
      by (unfold approx_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   300
    with f have "starfun f x \<approx> starfun f y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   301
      by (simp add: isNSUCont_def)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   302
    then have "starfun f x - starfun f y \<in> Infinitesimal"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   303
      by (unfold approx_def)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   304
    then show "hnorm (starfun f x - starfun f y) < star_of r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   305
      using r by (rule InfinitesimalD2)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   306
  qed
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 63579
diff changeset
   307
  then show "\<exists>s>0. \<forall>x y. norm (x - y) < s \<longrightarrow> norm (f x - f y) < r"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   308
    by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   309
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   310
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   311
end