src/HOL/Real/Hyperreal/Lim.thy
author paulson
Tue, 12 Dec 2000 12:01:19 +0100
changeset 10648 a8c647cfa31f
parent 10607 352f6f209775
child 10677 36625483213f
permissions -rw-r--r--
first stage in tidying up Real and Hyperreal. Factor cancellation simprocs inverse #0 = #0 simprules for division corrected ambigous syntax definitions in Hyperreal
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     1
(*  Title       : Lim.thy
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     3
    Copyright   : 1998  University of Cambridge
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     4
    Description : Theory of limits, continuity and 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     5
                  differentiation of real=>real functions
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     6
*)
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     7
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     8
Lim = SEQ + RealAbs + 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
     9
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    10
     (*-----------------------------------------------------------------------
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    11
         Limits, continuity and differentiation: standard and NS definitions
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    12
      -----------------------------------------------------------------------*)
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    13
constdefs
10648
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    14
      LIM :: [real=>real,real,real] => bool
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    15
                                    ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    16
      "f -- a --> L ==
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    17
         ALL r. #0 < r --> 
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    18
                 (EX s. #0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    19
                              --> abs(f x + -L) < r)))"
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    20
10648
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    21
      NSLIM :: [real=>real,real,real] => bool
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    22
                                  ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60)
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    23
      "f -- a --NS> L == (ALL x. (x ~= hypreal_of_real a & 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    24
                          x @= hypreal_of_real a --> (*f* f) x @= hypreal_of_real L))"   
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    25
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    26
      isCont :: [real=>real,real] => bool
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    27
      "isCont f a == (f -- a --> (f a))"        
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    28
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    29
      (* NS definition dispenses with limit notions *)
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    30
      isNSCont :: [real=>real,real] => bool
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    31
      "isNSCont f a == (ALL y. y @= hypreal_of_real a --> 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    32
                               (*f* f) y @= hypreal_of_real (f a))"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    33
      
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    34
      (* differentiation: D is derivative of function f at x *)
10648
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    35
      deriv:: [real=>real,real,real] => bool
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    36
                                ("(DERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
10607
352f6f209775 converted rinv and hrinv to inverse;
bauerg
parents: 10045
diff changeset
    37
      "DERIV f x :> D == ((%h. (f(x + h) + -f(x))*inverse(h)) -- #0 --> D)"
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    38
10648
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    39
      nsderiv :: [real=>real,real,real] => bool
a8c647cfa31f first stage in tidying up Real and Hyperreal.
paulson
parents: 10607
diff changeset
    40
                                ("(NSDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    41
      "NSDERIV f x :> D == (ALL h: Infinitesimal - {0}. 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    42
                            ((*f* f)(hypreal_of_real x + h) + 
10607
352f6f209775 converted rinv and hrinv to inverse;
bauerg
parents: 10045
diff changeset
    43
                             -hypreal_of_real (f x))*inverse(h) @= hypreal_of_real D)"
10045
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    44
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    45
      differentiable :: [real=>real,real] => bool   (infixl 60)
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    46
      "f differentiable x == (EX D. DERIV f x :> D)"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    47
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    48
      NSdifferentiable :: [real=>real,real] => bool   (infixl 60)
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    49
      "f NSdifferentiable x == (EX D. NSDERIV f x :> D)"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    50
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    51
      increment :: [real=>real,real,hypreal] => hypreal
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    52
      "increment f x h == (@inc. f NSdifferentiable x & 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    53
                           inc = (*f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    54
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    55
      isUCont :: (real=>real) => bool
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    56
      "isUCont f ==  (ALL r. #0 < r --> 
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    57
                          (EX s. #0 < s & (ALL x y. abs(x + -y) < s
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    58
                                --> abs(f x + -f y) < r)))"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    59
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    60
      isNSUCont :: (real=>real) => bool
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    61
      "isNSUCont f == (ALL x y. x @= y --> (*f* f) x @= (*f* f) y)"
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    62
end
c76b73e16711 New theories: construction of hypernaturals, nonstandard extensions,
fleuriot
parents:
diff changeset
    63