src/HOL/Hyperreal/Deriv.thy
changeset 21404 eb85850d3eb7
parent 21239 d4fbe2c87ef1
child 21784 e76faa6e65fd
equal deleted inserted replaced
21403:dd58f13a8eb4 21404:eb85850d3eb7
    13 begin
    13 begin
    14 
    14 
    15 text{*Standard and Nonstandard Definitions*}
    15 text{*Standard and Nonstandard Definitions*}
    16 
    16 
    17 definition
    17 definition
    18 
       
    19   deriv :: "[real \<Rightarrow> 'a::real_normed_vector, real, 'a] \<Rightarrow> bool"
    18   deriv :: "[real \<Rightarrow> 'a::real_normed_vector, real, 'a] \<Rightarrow> bool"
    20     --{*Differentiation: D is derivative of function f at x*}
    19     --{*Differentiation: D is derivative of function f at x*}
    21           ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
    20           ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where
    22   "DERIV f x :> D = ((%h. (f(x + h) - f x) /# h) -- 0 --> D)"
    21   "DERIV f x :> D = ((%h. (f(x + h) - f x) /# h) -- 0 --> D)"
    23 
    22 
       
    23 definition
    24   nsderiv :: "[real=>real,real,real] => bool"
    24   nsderiv :: "[real=>real,real,real] => bool"
    25           ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
    25           ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where
    26   "NSDERIV f x :> D = (\<forall>h \<in> Infinitesimal - {0}.
    26   "NSDERIV f x :> D = (\<forall>h \<in> Infinitesimal - {0}.
    27       (( *f* f)(hypreal_of_real x + h)
    27       (( *f* f)(hypreal_of_real x + h)
    28        - hypreal_of_real (f x))/h @= hypreal_of_real D)"
    28        - hypreal_of_real (f x))/h @= hypreal_of_real D)"
    29 
    29 
    30   differentiable :: "[real=>real,real] => bool"   (infixl "differentiable" 60)
    30 definition
       
    31   differentiable :: "[real=>real,real] => bool"   (infixl "differentiable" 60) where
    31   "f differentiable x = (\<exists>D. DERIV f x :> D)"
    32   "f differentiable x = (\<exists>D. DERIV f x :> D)"
    32 
    33 
       
    34 definition
    33   NSdifferentiable :: "[real=>real,real] => bool"
    35   NSdifferentiable :: "[real=>real,real] => bool"
    34                        (infixl "NSdifferentiable" 60)
    36                        (infixl "NSdifferentiable" 60) where
    35   "f NSdifferentiable x = (\<exists>D. NSDERIV f x :> D)"
    37   "f NSdifferentiable x = (\<exists>D. NSDERIV f x :> D)"
    36 
    38 
    37   increment :: "[real=>real,real,hypreal] => hypreal"
    39 definition
       
    40   increment :: "[real=>real,real,hypreal] => hypreal" where
    38   "increment f x h = (@inc. f NSdifferentiable x &
    41   "increment f x h = (@inc. f NSdifferentiable x &
    39            inc = ( *f* f)(hypreal_of_real x + h) - hypreal_of_real (f x))"
    42            inc = ( *f* f)(hypreal_of_real x + h) - hypreal_of_real (f x))"
    40 
    43 
    41 
    44 
    42 consts
    45 consts