src/HOL/Hyperreal/Lim.thy
author paulson
Fri Nov 28 12:09:37 2003 +0100 (2003-11-28)
changeset 14269 502a7c95de73
parent 13810 c3fbfd472365
child 14387 e96d5c42c4b0
permissions -rw-r--r--
conversion of some Real theories to Isar scripts
paulson@10751
     1
(*  Title       : Lim.thy
paulson@10751
     2
    Author      : Jacques D. Fleuriot
paulson@10751
     3
    Copyright   : 1998  University of Cambridge
paulson@10751
     4
    Description : Theory of limits, continuity and 
paulson@10751
     5
                  differentiation of real=>real functions
paulson@10751
     6
*)
paulson@10751
     7
paulson@14269
     8
Lim = SEQ + RealArith + 
paulson@10751
     9
paulson@10751
    10
(*-----------------------------------------------------------------------
paulson@10751
    11
    Limits, continuity and differentiation: standard and NS definitions
paulson@10751
    12
 -----------------------------------------------------------------------*)
paulson@10751
    13
paulson@10751
    14
constdefs
paulson@10751
    15
  LIM :: [real=>real,real,real] => bool
paulson@10751
    16
				("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
paulson@10751
    17
  "f -- a --> L ==
paulson@12018
    18
     ALL r. 0 < r --> 
paulson@12018
    19
	     (EX s. 0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
paulson@10751
    20
			  --> abs(f x + -L) < r)))"
paulson@10751
    21
paulson@10751
    22
  NSLIM :: [real=>real,real,real] => bool
paulson@10751
    23
			      ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60)
paulson@10751
    24
  "f -- a --NS> L == (ALL x. (x ~= hypreal_of_real a & 
paulson@10751
    25
		      x @= hypreal_of_real a -->
nipkow@13810
    26
		      ( *f* f) x @= hypreal_of_real L))"   
paulson@10751
    27
paulson@10751
    28
  isCont :: [real=>real,real] => bool
paulson@10751
    29
  "isCont f a == (f -- a --> (f a))"        
paulson@10751
    30
paulson@10751
    31
  (* NS definition dispenses with limit notions *)
paulson@10751
    32
  isNSCont :: [real=>real,real] => bool
paulson@10751
    33
  "isNSCont f a == (ALL y. y @= hypreal_of_real a --> 
nipkow@13810
    34
			   ( *f* f) y @= hypreal_of_real (f a))"
paulson@10751
    35
paulson@10751
    36
  (* differentiation: D is derivative of function f at x *)
paulson@10751
    37
  deriv:: [real=>real,real,real] => bool
paulson@10751
    38
			    ("(DERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
paulson@12018
    39
  "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- 0 --> D)"
paulson@10751
    40
paulson@10751
    41
  nsderiv :: [real=>real,real,real] => bool
paulson@10751
    42
			    ("(NSDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
paulson@10751
    43
  "NSDERIV f x :> D == (ALL h: Infinitesimal - {0}. 
nipkow@13810
    44
			(( *f* f)(hypreal_of_real x + h) + 
paulson@10751
    45
			 - hypreal_of_real (f x))/h @= hypreal_of_real D)"
paulson@10751
    46
paulson@10751
    47
  differentiable :: [real=>real,real] => bool   (infixl 60)
paulson@10751
    48
  "f differentiable x == (EX D. DERIV f x :> D)"
paulson@10751
    49
paulson@10751
    50
  NSdifferentiable :: [real=>real,real] => bool   (infixl 60)
paulson@10751
    51
  "f NSdifferentiable x == (EX D. NSDERIV f x :> D)"
paulson@10751
    52
paulson@10751
    53
  increment :: [real=>real,real,hypreal] => hypreal
paulson@10751
    54
  "increment f x h == (@inc. f NSdifferentiable x & 
nipkow@13810
    55
		       inc = ( *f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))"
paulson@10751
    56
paulson@10751
    57
  isUCont :: (real=>real) => bool
paulson@12018
    58
  "isUCont f ==  (ALL r. 0 < r --> 
paulson@12018
    59
		      (EX s. 0 < s & (ALL x y. abs(x + -y) < s
paulson@10751
    60
			    --> abs(f x + -f y) < r)))"
paulson@10751
    61
paulson@10751
    62
  isNSUCont :: (real=>real) => bool
nipkow@13810
    63
  "isNSUCont f == (ALL x y. x @= y --> ( *f* f) x @= ( *f* f) y)"
paulson@10751
    64
paulson@10751
    65
paulson@10751
    66
(*Used in the proof of the Bolzano theorem*)
paulson@10751
    67
consts
paulson@10751
    68
  Bolzano_bisect :: "[real*real=>bool, real, real, nat] => (real*real)"
paulson@10751
    69
paulson@10751
    70
primrec
paulson@10751
    71
  "Bolzano_bisect P a b 0 = (a,b)"
paulson@10751
    72
  "Bolzano_bisect P a b (Suc n) =
paulson@10751
    73
      (let (x,y) = Bolzano_bisect P a b n
wenzelm@11704
    74
       in if P(x, (x+y)/2) then ((x+y)/2, y)
wenzelm@11704
    75
                            else (x, (x+y)/2) )"
paulson@10751
    76
  
paulson@10751
    77
paulson@10751
    78
end
paulson@10751
    79