src/HOL/Hyperreal/NSA.thy
author huffman
Wed, 09 May 2007 18:25:44 +0200
changeset 22889 f3bb32a68f16
parent 22882 bc10bb8d0809
child 22997 d4f3b015b50b
permissions -rw-r--r--
add lemma hnorm_hyperpow
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       : NSA.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
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
     4
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
     5
Converted to Isar and polished by lcp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
     6
*)
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     7
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
     8
header{*Infinite Numbers, Infinitesimals, Infinitely Close Relation*}
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
     9
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15003
diff changeset
    10
theory NSA
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
    11
imports HyperDef "../Real/RComplete"
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15003
diff changeset
    12
begin
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    13
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    14
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    15
  hnorm :: "'a::norm star \<Rightarrow> real star" where
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    16
  "hnorm = *f* norm"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    17
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    18
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    19
  Infinitesimal  :: "('a::real_normed_vector) star set" where
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    20
  "Infinitesimal = {x. \<forall>r \<in> Reals. 0 < r --> hnorm x < r}"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    21
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    22
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    23
  HFinite :: "('a::real_normed_vector) star set" where
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    24
  "HFinite = {x. \<exists>r \<in> Reals. hnorm x < r}"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    25
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    26
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    27
  HInfinite :: "('a::real_normed_vector) star set" where
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    28
  "HInfinite = {x. \<forall>r \<in> Reals. r < hnorm x}"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    29
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    30
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    31
  approx :: "['a::real_normed_vector star, 'a star] => bool"  (infixl "@=" 50) where
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
    32
    --{*the `infinitely close' relation*}
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
    33
  "(x @= y) = ((x - y) \<in> Infinitesimal)"
14653
0848ab6fe5fc constdefs: proper order;
wenzelm
parents: 14565
diff changeset
    34
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    35
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    36
  st        :: "hypreal => hypreal" where
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
    37
    --{*the standard part of a hyperreal*}
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    38
  "st = (%x. @r. x \<in> HFinite & r \<in> Reals & r @= x)"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    39
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    40
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    41
  monad     :: "'a::real_normed_vector star => 'a star set" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    42
  "monad x = {y. x @= y}"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    43
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    44
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    45
  galaxy    :: "'a::real_normed_vector star => 'a star set" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    46
  "galaxy x = {y. (x + -y) \<in> HFinite}"
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    47
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 20794
diff changeset
    48
notation (xsymbols)
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    49
  approx  (infixl "\<approx>" 50)
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    50
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 20794
diff changeset
    51
notation (HTML output)
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
    52
  approx  (infixl "\<approx>" 50)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
    53
20554
c433e78d4203 define new constant of_real for class real_algebra_1;
huffman
parents: 20552
diff changeset
    54
lemma SReal_def: "Reals == {x. \<exists>r. x = hypreal_of_real r}"
20729
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20728
diff changeset
    55
by (simp add: Reals_def image_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
    56
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
    57
subsection {* Nonstandard Extension of the Norm Function *}
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    58
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    59
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    60
  scaleHR :: "real star \<Rightarrow> 'a star \<Rightarrow> 'a::real_normed_vector star" where
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    61
  "scaleHR = starfun2 scaleR"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    62
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    63
declare hnorm_def [transfer_unfold]
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    64
declare scaleHR_def [transfer_unfold]
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    65
20728
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    66
lemma Standard_hnorm [simp]: "x \<in> Standard \<Longrightarrow> hnorm x \<in> Standard"
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    67
by (simp add: hnorm_def)
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    68
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    69
lemma star_of_norm [simp]: "star_of (norm x) = hnorm (star_of x)"
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    70
by transfer (rule refl)
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
    71
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    72
lemma hnorm_ge_zero [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    73
  "\<And>x::'a::real_normed_vector star. 0 \<le> hnorm x"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    74
by transfer (rule norm_ge_zero)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    75
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    76
lemma hnorm_eq_zero [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    77
  "\<And>x::'a::real_normed_vector star. (hnorm x = 0) = (x = 0)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    78
by transfer (rule norm_eq_zero)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    79
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    80
lemma hnorm_triangle_ineq:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    81
  "\<And>x y::'a::real_normed_vector star. hnorm (x + y) \<le> hnorm x + hnorm y"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    82
by transfer (rule norm_triangle_ineq)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    83
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
    84
lemma hnorm_triangle_ineq3:
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
    85
  "\<And>x y::'a::real_normed_vector star. \<bar>hnorm x - hnorm y\<bar> \<le> hnorm (x - y)"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
    86
by transfer (rule norm_triangle_ineq3)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
    87
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    88
lemma hnorm_scaleR:
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    89
  "\<And>x::'a::real_normed_vector star.
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    90
   hnorm (a *# x) = \<bar>star_of a\<bar> * hnorm x"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    91
by transfer (rule norm_scaleR)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    92
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    93
lemma hnorm_scaleHR:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    94
  "\<And>a (x::'a::real_normed_vector star).
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
    95
   hnorm (scaleHR a x) = \<bar>a\<bar> * hnorm x"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    96
by transfer (rule norm_scaleR)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    97
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    98
lemma hnorm_mult_ineq:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
    99
  "\<And>x y::'a::real_normed_algebra star. hnorm (x * y) \<le> hnorm x * hnorm y"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   100
by transfer (rule norm_mult_ineq)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   101
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   102
lemma hnorm_mult:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   103
  "\<And>x y::'a::real_normed_div_algebra star. hnorm (x * y) = hnorm x * hnorm y"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   104
by transfer (rule norm_mult)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   105
22889
f3bb32a68f16 add lemma hnorm_hyperpow
huffman
parents: 22882
diff changeset
   106
lemma hnorm_hyperpow:
f3bb32a68f16 add lemma hnorm_hyperpow
huffman
parents: 22882
diff changeset
   107
  "\<And>(x::'a::{real_normed_div_algebra,recpower} star) n.
f3bb32a68f16 add lemma hnorm_hyperpow
huffman
parents: 22882
diff changeset
   108
   hnorm (x pow n) = hnorm x pow n"
f3bb32a68f16 add lemma hnorm_hyperpow
huffman
parents: 22882
diff changeset
   109
by transfer (rule norm_power)
f3bb32a68f16 add lemma hnorm_hyperpow
huffman
parents: 22882
diff changeset
   110
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   111
lemma hnorm_one [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   112
  "hnorm (1\<Colon>'a::real_normed_div_algebra star) = 1"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   113
by transfer (rule norm_one)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   114
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   115
lemma hnorm_zero [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   116
  "hnorm (0\<Colon>'a::real_normed_vector star) = 0"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   117
by transfer (rule norm_zero)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   118
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   119
lemma zero_less_hnorm_iff [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   120
  "\<And>x::'a::real_normed_vector star. (0 < hnorm x) = (x \<noteq> 0)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   121
by transfer (rule zero_less_norm_iff)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   122
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   123
lemma hnorm_minus_cancel [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   124
  "\<And>x::'a::real_normed_vector star. hnorm (- x) = hnorm x"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   125
by transfer (rule norm_minus_cancel)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   126
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   127
lemma hnorm_minus_commute:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   128
  "\<And>a b::'a::real_normed_vector star. hnorm (a - b) = hnorm (b - a)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   129
by transfer (rule norm_minus_commute)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   130
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   131
lemma hnorm_triangle_ineq2:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   132
  "\<And>a b::'a::real_normed_vector star. hnorm a - hnorm b \<le> hnorm (a - b)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   133
by transfer (rule norm_triangle_ineq2)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   134
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   135
lemma hnorm_triangle_ineq4:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   136
  "\<And>a b::'a::real_normed_vector star. hnorm (a - b) \<le> hnorm a + hnorm b"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   137
by transfer (rule norm_triangle_ineq4)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   138
22881
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   139
lemma abs_hnorm_cancel [simp]:
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   140
  "\<And>a::'a::real_normed_vector star. \<bar>hnorm a\<bar> = hnorm a"
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   141
by transfer (rule abs_norm_cancel)
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   142
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   143
lemma hnorm_of_hypreal [simp]:
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   144
  "\<And>r. hnorm (of_hypreal r::'a::real_normed_algebra_1 star) = \<bar>r\<bar>"
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   145
by transfer (rule norm_of_real)
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   146
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   147
lemma nonzero_hnorm_inverse:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   148
  "\<And>a::'a::real_normed_div_algebra star.
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   149
   a \<noteq> 0 \<Longrightarrow> hnorm (inverse a) = inverse (hnorm a)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   150
by transfer (rule nonzero_norm_inverse)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   151
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   152
lemma hnorm_inverse:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   153
  "\<And>a::'a::{real_normed_div_algebra,division_by_zero} star.
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   154
   hnorm (inverse a) = inverse (hnorm a)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   155
by transfer (rule norm_inverse)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   156
22882
bc10bb8d0809 add lemma hnorm_divide
huffman
parents: 22881
diff changeset
   157
lemma hnorm_divide:
bc10bb8d0809 add lemma hnorm_divide
huffman
parents: 22881
diff changeset
   158
  "\<And>a b::'a::{real_normed_field,division_by_zero} star.
bc10bb8d0809 add lemma hnorm_divide
huffman
parents: 22881
diff changeset
   159
   hnorm (a / b) = hnorm a / hnorm b"
bc10bb8d0809 add lemma hnorm_divide
huffman
parents: 22881
diff changeset
   160
by transfer (rule norm_divide)
bc10bb8d0809 add lemma hnorm_divide
huffman
parents: 22881
diff changeset
   161
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   162
lemma hypreal_hnorm_def [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   163
  "\<And>r::hypreal. hnorm r \<equiv> \<bar>r\<bar>"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   164
by transfer (rule real_norm_def)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   165
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   166
lemma hnorm_add_less:
22881
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   167
  "\<And>(x::'a::real_normed_vector star) y r s.
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   168
   \<lbrakk>hnorm x < r; hnorm y < s\<rbrakk> \<Longrightarrow> hnorm (x + y) < r + s"
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   169
by transfer (rule norm_add_less)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   170
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   171
lemma hnorm_mult_less:
22881
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   172
  "\<And>(x::'a::real_normed_algebra star) y r s.
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   173
   \<lbrakk>hnorm x < r; hnorm y < s\<rbrakk> \<Longrightarrow> hnorm (x * y) < r * s"
c23ded11158f add lemmas abs_hnorm_cancel, hnorm_of_hypreal
huffman
parents: 22630
diff changeset
   174
by transfer (rule norm_mult_less)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   175
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   176
lemma hnorm_scaleHR_less:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   177
  "\<lbrakk>\<bar>x\<bar> < r; hnorm y < s\<rbrakk> \<Longrightarrow> hnorm (scaleHR x y) < r * s"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   178
apply (simp only: hnorm_scaleHR)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   179
apply (simp add: mult_strict_mono')
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   180
done
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   181
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   182
subsection{*Closure Laws for the Standard Reals*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   183
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   184
lemma Reals_minus_iff [simp]: "(-x \<in> Reals) = (x \<in> Reals)"
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   185
apply auto
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   186
apply (drule Reals_minus, auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   187
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   188
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   189
lemma Reals_add_cancel: "\<lbrakk>x + y \<in> Reals; y \<in> Reals\<rbrakk> \<Longrightarrow> x \<in> Reals"
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   190
by (drule (1) Reals_diff, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   191
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   192
lemma SReal_hrabs: "(x::hypreal) \<in> Reals ==> abs x \<in> Reals"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   193
by (simp add: Reals_eq_Standard)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   194
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   195
lemma SReal_hypreal_of_real [simp]: "hypreal_of_real x \<in> Reals"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   196
by (simp add: Reals_eq_Standard)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   197
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   198
lemma SReal_divide_number_of: "r \<in> Reals ==> r/(number_of w::hypreal) \<in> Reals"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   199
by simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   200
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   201
text{*epsilon is not in Reals because it is an infinitesimal*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   202
lemma SReal_epsilon_not_mem: "epsilon \<notin> Reals"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   203
apply (simp add: SReal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   204
apply (auto simp add: hypreal_of_real_not_eq_epsilon [THEN not_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   205
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   206
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   207
lemma SReal_omega_not_mem: "omega \<notin> Reals"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   208
apply (simp add: SReal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   209
apply (auto simp add: hypreal_of_real_not_eq_omega [THEN not_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   210
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   211
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   212
lemma SReal_UNIV_real: "{x. hypreal_of_real x \<in> Reals} = (UNIV::real set)"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   213
by simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   214
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   215
lemma SReal_iff: "(x \<in> Reals) = (\<exists>y. x = hypreal_of_real y)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   216
by (simp add: SReal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   217
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   218
lemma hypreal_of_real_image: "hypreal_of_real `(UNIV::real set) = Reals"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   219
by (simp add: Reals_eq_Standard Standard_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   220
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   221
lemma inv_hypreal_of_real_image: "inv hypreal_of_real ` Reals = UNIV"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   222
apply (auto simp add: SReal_def)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   223
apply (rule inj_star_of [THEN inv_f_f, THEN subst], blast)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   224
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   225
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   226
lemma SReal_hypreal_of_real_image:
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   227
      "[| \<exists>x. x: P; P \<subseteq> Reals |] ==> \<exists>Q. P = hypreal_of_real ` Q"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   228
by (simp add: SReal_def image_def, blast)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   229
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   230
lemma SReal_dense:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   231
     "[| (x::hypreal) \<in> Reals; y \<in> Reals;  x<y |] ==> \<exists>r \<in> Reals. x<r & r<y"
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   232
apply (auto simp add: SReal_def)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   233
apply (drule dense, auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   234
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   235
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   236
text{*Completeness of Reals, but both lemmas are unused.*}
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   237
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   238
lemma SReal_sup_lemma:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   239
     "P \<subseteq> Reals ==> ((\<exists>x \<in> P. y < x) =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   240
      (\<exists>X. hypreal_of_real X \<in> P & y < hypreal_of_real X))"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   241
by (blast dest!: SReal_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   242
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   243
lemma SReal_sup_lemma2:
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   244
     "[| P \<subseteq> Reals; \<exists>x. x \<in> P; \<exists>y \<in> Reals. \<forall>x \<in> P. x < y |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   245
      ==> (\<exists>X. X \<in> {w. hypreal_of_real w \<in> P}) &
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   246
          (\<exists>Y. \<forall>X \<in> {w. hypreal_of_real w \<in> P}. X < Y)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   247
apply (rule conjI)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   248
apply (fast dest!: SReal_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   249
apply (auto, frule subsetD, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   250
apply (drule SReal_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   251
apply (auto, rule_tac x = ya in exI, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   252
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   253
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   254
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   255
subsection{* Set of Finite Elements is a Subring of the Extended Reals*}
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   256
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   257
lemma HFinite_add: "[|x \<in> HFinite; y \<in> HFinite|] ==> (x+y) \<in> HFinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   258
apply (simp add: HFinite_def)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   259
apply (blast intro!: Reals_add hnorm_add_less)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   260
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   261
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   262
lemma HFinite_mult:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   263
  fixes x y :: "'a::real_normed_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   264
  shows "[|x \<in> HFinite; y \<in> HFinite|] ==> x*y \<in> HFinite"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   265
apply (simp add: HFinite_def)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   266
apply (blast intro!: Reals_mult hnorm_mult_less)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   267
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   268
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   269
lemma HFinite_scaleHR:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   270
  "[|x \<in> HFinite; y \<in> HFinite|] ==> scaleHR x y \<in> HFinite"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   271
apply (simp add: HFinite_def)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   272
apply (blast intro!: Reals_mult hnorm_scaleHR_less)
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   273
done
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   274
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   275
lemma HFinite_minus_iff: "(-x \<in> HFinite) = (x \<in> HFinite)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   276
by (simp add: HFinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   277
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   278
lemma HFinite_star_of [simp]: "star_of x \<in> HFinite"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   279
apply (simp add: HFinite_def)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   280
apply (rule_tac x="star_of (norm x) + 1" in bexI)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   281
apply (transfer, simp)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   282
apply (blast intro: Reals_add SReal_hypreal_of_real Reals_1)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   283
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   284
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   285
lemma SReal_subset_HFinite: "(Reals::hypreal set) \<subseteq> HFinite"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   286
by (auto simp add: SReal_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   287
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   288
lemma HFiniteD: "x \<in> HFinite ==> \<exists>t \<in> Reals. hnorm x < t"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   289
by (simp add: HFinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   290
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   291
lemma HFinite_hrabs_iff [iff]: "(abs (x::hypreal) \<in> HFinite) = (x \<in> HFinite)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   292
by (simp add: HFinite_def)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   293
20562
c2f672be8522 add type constraint to otherwise looping iff rule
huffman
parents: 20554
diff changeset
   294
lemma HFinite_hnorm_iff [iff]:
c2f672be8522 add type constraint to otherwise looping iff rule
huffman
parents: 20554
diff changeset
   295
  "(hnorm (x::hypreal) \<in> HFinite) = (x \<in> HFinite)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   296
by (simp add: HFinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   297
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   298
lemma HFinite_number_of [simp]: "number_of w \<in> HFinite"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   299
unfolding star_number_def by (rule HFinite_star_of)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   300
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   301
(** As always with numerals, 0 and 1 are special cases **)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   302
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   303
lemma HFinite_0 [simp]: "0 \<in> HFinite"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   304
unfolding star_zero_def by (rule HFinite_star_of)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   305
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   306
lemma HFinite_1 [simp]: "1 \<in> HFinite"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   307
unfolding star_one_def by (rule HFinite_star_of)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   308
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   309
lemma hrealpow_HFinite:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   310
  fixes x :: "'a::{real_normed_algebra,recpower} star"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   311
  shows "x \<in> HFinite ==> x ^ n \<in> HFinite"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   312
apply (induct_tac "n")
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   313
apply (auto simp add: power_Suc intro: HFinite_mult)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   314
done
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   315
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   316
lemma HFinite_bounded:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   317
  "[|(x::hypreal) \<in> HFinite; y \<le> x; 0 \<le> y |] ==> y \<in> HFinite"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   318
apply (case_tac "x \<le> 0")
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   319
apply (drule_tac y = x in order_trans)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   320
apply (drule_tac [2] order_antisym)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   321
apply (auto simp add: linorder_not_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   322
apply (auto intro: order_le_less_trans simp add: abs_if HFinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   323
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   324
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   325
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   326
subsection{* Set of Infinitesimals is a Subring of the Hyperreals*}
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   327
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   328
lemma InfinitesimalI:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   329
  "(\<And>r. \<lbrakk>r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> hnorm x < r) \<Longrightarrow> x \<in> Infinitesimal"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   330
by (simp add: Infinitesimal_def)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   331
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   332
lemma InfinitesimalD:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   333
      "x \<in> Infinitesimal ==> \<forall>r \<in> Reals. 0 < r --> hnorm x < r"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   334
by (simp add: Infinitesimal_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   335
20749
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   336
lemma InfinitesimalI2:
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   337
  "(\<And>r. 0 < r \<Longrightarrow> hnorm x < star_of r) \<Longrightarrow> x \<in> Infinitesimal"
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   338
by (auto simp add: Infinitesimal_def SReal_def)
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   339
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   340
lemma InfinitesimalD2:
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   341
  "\<lbrakk>x \<in> Infinitesimal; 0 < r\<rbrakk> \<Longrightarrow> hnorm x < star_of r"
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   342
by (auto simp add: Infinitesimal_def SReal_def)
f7f2d03fe6f9 add lemmas InfinitesimalI2, InfinitesimalD2
huffman
parents: 20743
diff changeset
   343
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   344
lemma Infinitesimal_zero [iff]: "0 \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   345
by (simp add: Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   346
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   347
lemma hypreal_sum_of_halves: "x/(2::hypreal) + x/(2::hypreal) = x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   348
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   349
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   350
lemma Infinitesimal_add:
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   351
     "[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> (x+y) \<in> Infinitesimal"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   352
apply (rule InfinitesimalI)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   353
apply (rule hypreal_sum_of_halves [THEN subst])
14477
cc61fd03e589 conversion of Hyperreal/Lim to new-style
paulson
parents: 14468
diff changeset
   354
apply (drule half_gt_zero)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   355
apply (blast intro: hnorm_add_less SReal_divide_number_of dest: InfinitesimalD)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   356
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   357
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   358
lemma Infinitesimal_minus_iff [simp]: "(-x:Infinitesimal) = (x:Infinitesimal)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   359
by (simp add: Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   360
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   361
lemma Infinitesimal_hnorm_iff:
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   362
  "(hnorm x \<in> Infinitesimal) = (x \<in> Infinitesimal)"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   363
by (simp add: Infinitesimal_def)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   364
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   365
lemma Infinitesimal_diff:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   366
     "[| x \<in> Infinitesimal;  y \<in> Infinitesimal |] ==> x-y \<in> Infinitesimal"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   367
by (simp add: diff_def Infinitesimal_add)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   368
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   369
lemma Infinitesimal_mult:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   370
  fixes x y :: "'a::real_normed_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   371
  shows "[|x \<in> Infinitesimal; y \<in> Infinitesimal|] ==> (x * y) \<in> Infinitesimal"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   372
apply (rule InfinitesimalI)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   373
apply (subgoal_tac "hnorm (x * y) < 1 * r", simp only: mult_1)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   374
apply (rule hnorm_mult_less)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   375
apply (simp_all add: InfinitesimalD)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   376
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   377
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   378
lemma Infinitesimal_HFinite_mult:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   379
  fixes x y :: "'a::real_normed_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   380
  shows "[| x \<in> Infinitesimal; y \<in> HFinite |] ==> (x * y) \<in> Infinitesimal"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   381
apply (rule InfinitesimalI)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   382
apply (drule HFiniteD, clarify)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   383
apply (subgoal_tac "0 < t")
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   384
apply (subgoal_tac "hnorm (x * y) < (r / t) * t", simp)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   385
apply (subgoal_tac "0 < r / t")
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   386
apply (rule hnorm_mult_less)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   387
apply (simp add: InfinitesimalD Reals_divide)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   388
apply assumption
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   389
apply (simp only: divide_pos_pos)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   390
apply (erule order_le_less_trans [OF hnorm_ge_zero])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   391
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   392
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   393
lemma Infinitesimal_HFinite_scaleHR:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   394
  "[| x \<in> Infinitesimal; y \<in> HFinite |] ==> scaleHR x y \<in> Infinitesimal"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   395
apply (rule InfinitesimalI)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   396
apply (drule HFiniteD, clarify)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   397
apply (drule InfinitesimalD)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   398
apply (simp add: hnorm_scaleHR)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   399
apply (subgoal_tac "0 < t")
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   400
apply (subgoal_tac "\<bar>x\<bar> * hnorm y < (r / t) * t", simp)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   401
apply (subgoal_tac "0 < r / t")
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   402
apply (rule mult_strict_mono', simp_all)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   403
apply (simp only: divide_pos_pos)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   404
apply (erule order_le_less_trans [OF hnorm_ge_zero])
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   405
done
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   406
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   407
lemma Infinitesimal_HFinite_mult2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   408
  fixes x y :: "'a::real_normed_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   409
  shows "[| x \<in> Infinitesimal; y \<in> HFinite |] ==> (y * x) \<in> Infinitesimal"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   410
apply (rule InfinitesimalI)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   411
apply (drule HFiniteD, clarify)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   412
apply (subgoal_tac "0 < t")
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   413
apply (subgoal_tac "hnorm (y * x) < t * (r / t)", simp)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   414
apply (subgoal_tac "0 < r / t")
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   415
apply (rule hnorm_mult_less)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   416
apply assumption
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   417
apply (simp add: InfinitesimalD Reals_divide)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   418
apply (simp only: divide_pos_pos)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   419
apply (erule order_le_less_trans [OF hnorm_ge_zero])
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   420
done
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   421
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   422
lemma Infinitesimal_scaleR2:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   423
  "x \<in> Infinitesimal ==> a *# x \<in> Infinitesimal"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   424
apply (case_tac "a = 0", simp)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   425
apply (rule InfinitesimalI)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   426
apply (drule InfinitesimalD)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   427
apply (drule_tac x="r / \<bar>star_of a\<bar>" in bspec)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   428
apply (simp add: Reals_eq_Standard)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   429
apply (simp add: divide_pos_pos)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   430
apply (simp add: hnorm_scaleR pos_less_divide_eq mult_commute)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   431
done
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   432
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   433
lemma Compl_HFinite: "- HFinite = HInfinite"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   434
apply (auto simp add: HInfinite_def HFinite_def linorder_not_less)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   435
apply (rule_tac y="r + 1" in order_less_le_trans, simp)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   436
apply simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   437
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   438
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   439
lemma HInfinite_inverse_Infinitesimal:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   440
  fixes x :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   441
  shows "x \<in> HInfinite ==> inverse x \<in> Infinitesimal"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   442
apply (rule InfinitesimalI)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   443
apply (subgoal_tac "x \<noteq> 0")
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   444
apply (rule inverse_less_imp_less)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   445
apply (simp add: nonzero_hnorm_inverse)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   446
apply (simp add: HInfinite_def Reals_inverse)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   447
apply assumption
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   448
apply (clarify, simp add: Compl_HFinite [symmetric])
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   449
done
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   450
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   451
lemma HInfiniteI: "(\<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x) \<Longrightarrow> x \<in> HInfinite"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   452
by (simp add: HInfinite_def)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   453
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   454
lemma HInfiniteD: "\<lbrakk>x \<in> HInfinite; r \<in> \<real>\<rbrakk> \<Longrightarrow> r < hnorm x"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   455
by (simp add: HInfinite_def)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   456
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   457
lemma HInfinite_mult:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   458
  fixes x y :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   459
  shows "[|x \<in> HInfinite; y \<in> HInfinite|] ==> (x*y) \<in> HInfinite"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   460
apply (rule HInfiniteI, simp only: hnorm_mult)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   461
apply (subgoal_tac "r * 1 < hnorm x * hnorm y", simp only: mult_1)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   462
apply (case_tac "x = 0", simp add: HInfinite_def)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   463
apply (rule mult_strict_mono)
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   464
apply (simp_all add: HInfiniteD)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   465
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   466
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   467
lemma hypreal_add_zero_less_le_mono: "[|r < x; (0::hypreal) \<le> y|] ==> r < x+y"
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   468
by (auto dest: add_less_le_mono)
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   469
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   470
lemma HInfinite_add_ge_zero:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   471
     "[|(x::hypreal) \<in> HInfinite; 0 \<le> y; 0 \<le> x|] ==> (x + y): HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   472
by (auto intro!: hypreal_add_zero_less_le_mono 
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   473
       simp add: abs_if add_commute add_nonneg_nonneg HInfinite_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   474
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   475
lemma HInfinite_add_ge_zero2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   476
     "[|(x::hypreal) \<in> HInfinite; 0 \<le> y; 0 \<le> x|] ==> (y + x): HInfinite"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   477
by (auto intro!: HInfinite_add_ge_zero simp add: add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   478
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   479
lemma HInfinite_add_gt_zero:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   480
     "[|(x::hypreal) \<in> HInfinite; 0 < y; 0 < x|] ==> (x + y): HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   481
by (blast intro: HInfinite_add_ge_zero order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   482
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   483
lemma HInfinite_minus_iff: "(-x \<in> HInfinite) = (x \<in> HInfinite)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   484
by (simp add: HInfinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   485
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   486
lemma HInfinite_add_le_zero:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   487
     "[|(x::hypreal) \<in> HInfinite; y \<le> 0; x \<le> 0|] ==> (x + y): HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   488
apply (drule HInfinite_minus_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   489
apply (rule HInfinite_minus_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   490
apply (auto intro: HInfinite_add_ge_zero)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   491
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   492
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   493
lemma HInfinite_add_lt_zero:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   494
     "[|(x::hypreal) \<in> HInfinite; y < 0; x < 0|] ==> (x + y): HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   495
by (blast intro: HInfinite_add_le_zero order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   496
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   497
lemma HFinite_sum_squares:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   498
  fixes a b c :: "'a::real_normed_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   499
  shows "[|a: HFinite; b: HFinite; c: HFinite|]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   500
      ==> a*a + b*b + c*c \<in> HFinite"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   501
by (auto intro: HFinite_mult HFinite_add)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   502
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   503
lemma not_Infinitesimal_not_zero: "x \<notin> Infinitesimal ==> x \<noteq> 0"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   504
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   505
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   506
lemma not_Infinitesimal_not_zero2: "x \<in> HFinite - Infinitesimal ==> x \<noteq> 0"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   507
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   508
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   509
lemma Infinitesimal_hrabs_iff [iff]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   510
     "(abs (x::hypreal) \<in> Infinitesimal) = (x \<in> Infinitesimal)"
15003
6145dd7538d7 replaced monomorphic abs definitions by abs_if
paulson
parents: 14653
diff changeset
   511
by (auto simp add: abs_if)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   512
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   513
lemma HFinite_diff_Infinitesimal_hrabs:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   514
  "(x::hypreal) \<in> HFinite - Infinitesimal ==> abs x \<in> HFinite - Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   515
by blast
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   516
20743
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   517
lemma hnorm_le_Infinitesimal:
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   518
  "\<lbrakk>e \<in> Infinitesimal; hnorm x \<le> e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   519
by (auto simp add: Infinitesimal_def abs_less_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   520
20743
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   521
lemma hnorm_less_Infinitesimal:
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   522
  "\<lbrakk>e \<in> Infinitesimal; hnorm x < e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal"
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   523
by (erule hnorm_le_Infinitesimal, erule order_less_imp_le)
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   524
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   525
lemma hrabs_le_Infinitesimal:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   526
     "[| e \<in> Infinitesimal; abs (x::hypreal) \<le> e |] ==> x \<in> Infinitesimal"
20743
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   527
by (erule hnorm_le_Infinitesimal, simp)
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   528
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   529
lemma hrabs_less_Infinitesimal:
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   530
      "[| e \<in> Infinitesimal; abs (x::hypreal) < e |] ==> x \<in> Infinitesimal"
22b0e2f3fe7e add lemmas about hnorm, Infinitesimal
huffman
parents: 20730
diff changeset
   531
by (erule hnorm_less_Infinitesimal, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   532
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   533
lemma Infinitesimal_interval:
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   534
      "[| e \<in> Infinitesimal; e' \<in> Infinitesimal; e' < x ; x < e |] 
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   535
       ==> (x::hypreal) \<in> Infinitesimal"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   536
by (auto simp add: Infinitesimal_def abs_less_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   537
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   538
lemma Infinitesimal_interval2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   539
     "[| e \<in> Infinitesimal; e' \<in> Infinitesimal;
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   540
         e' \<le> x ; x \<le> e |] ==> (x::hypreal) \<in> Infinitesimal"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   541
by (auto intro: Infinitesimal_interval simp add: order_le_less)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   542
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   543
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   544
lemma lemma_Infinitesimal_hyperpow:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   545
     "[| (x::hypreal) \<in> Infinitesimal; 0 < N |] ==> abs (x pow N) \<le> abs x"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   546
apply (unfold Infinitesimal_def)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   547
apply (auto intro!: hyperpow_Suc_le_self2 
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   548
          simp add: hyperpow_hrabs [symmetric] hypnat_gt_zero_iff2 abs_ge_zero)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   549
done
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   550
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   551
lemma Infinitesimal_hyperpow:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   552
     "[| (x::hypreal) \<in> Infinitesimal; 0 < N |] ==> x pow N \<in> Infinitesimal"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   553
apply (rule hrabs_le_Infinitesimal)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   554
apply (rule_tac [2] lemma_Infinitesimal_hyperpow, auto)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   555
done
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   556
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   557
lemma hrealpow_hyperpow_Infinitesimal_iff:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   558
     "(x ^ n \<in> Infinitesimal) = (x pow (hypnat_of_nat n) \<in> Infinitesimal)"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   559
by (simp only: hyperpow_hypnat_of_nat)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   560
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   561
lemma Infinitesimal_hrealpow:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   562
     "[| (x::hypreal) \<in> Infinitesimal; 0 < n |] ==> x ^ n \<in> Infinitesimal"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   563
by (simp add: hrealpow_hyperpow_Infinitesimal_iff Infinitesimal_hyperpow)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
   564
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   565
lemma not_Infinitesimal_mult:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   566
  fixes x y :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   567
  shows "[| x \<notin> Infinitesimal;  y \<notin> Infinitesimal|] ==> (x*y) \<notin>Infinitesimal"
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   568
apply (unfold Infinitesimal_def, clarify, rename_tac r s)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   569
apply (simp only: linorder_not_less hnorm_mult)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   570
apply (drule_tac x = "r * s" in bspec)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   571
apply (fast intro: Reals_mult)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   572
apply (drule mp, blast intro: mult_pos_pos)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   573
apply (drule_tac c = s and d = "hnorm y" and a = r and b = "hnorm x" in mult_mono)
20407
93a34d5d1dc5 speed up some proofs
huffman
parents: 20254
diff changeset
   574
apply (simp_all (no_asm_simp))
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   575
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   576
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   577
lemma Infinitesimal_mult_disj:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   578
  fixes x y :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   579
  shows "x*y \<in> Infinitesimal ==> x \<in> Infinitesimal | y \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   580
apply (rule ccontr)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   581
apply (drule de_Morgan_disj [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   582
apply (fast dest: not_Infinitesimal_mult)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   583
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   584
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   585
lemma HFinite_Infinitesimal_not_zero: "x \<in> HFinite-Infinitesimal ==> x \<noteq> 0"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   586
by blast
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   587
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   588
lemma HFinite_Infinitesimal_diff_mult:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   589
  fixes x y :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   590
  shows "[| x \<in> HFinite - Infinitesimal;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   591
                   y \<in> HFinite - Infinitesimal
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   592
                |] ==> (x*y) \<in> HFinite - Infinitesimal"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   593
apply clarify
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   594
apply (blast dest: HFinite_mult not_Infinitesimal_mult)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   595
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   596
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   597
lemma Infinitesimal_subset_HFinite:
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   598
      "Infinitesimal \<subseteq> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   599
apply (simp add: Infinitesimal_def HFinite_def, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   600
apply (rule_tac x = 1 in bexI, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   601
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   602
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   603
lemma Infinitesimal_star_of_mult:
21783
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   604
  fixes x :: "'a::real_normed_algebra star"
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   605
  shows "x \<in> Infinitesimal ==> x * star_of r \<in> Infinitesimal"
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   606
by (erule HFinite_star_of [THEN [2] Infinitesimal_HFinite_mult])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   607
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   608
lemma Infinitesimal_star_of_mult2:
21783
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   609
  fixes x :: "'a::real_normed_algebra star"
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   610
  shows "x \<in> Infinitesimal ==> star_of r * x \<in> Infinitesimal"
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
   611
by (erule HFinite_star_of [THEN [2] Infinitesimal_HFinite_mult2])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   612
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   613
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   614
subsection{*The Infinitely Close Relation*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   615
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   616
lemma mem_infmal_iff: "(x \<in> Infinitesimal) = (x @= 0)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   617
by (simp add: Infinitesimal_def approx_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   618
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   619
lemma approx_minus_iff: " (x @= y) = (x - y @= 0)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   620
by (simp add: approx_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   621
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   622
lemma approx_minus_iff2: " (x @= y) = (-y + x @= 0)"
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   623
by (simp add: approx_def diff_minus add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   624
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   625
lemma approx_refl [iff]: "x @= x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   626
by (simp add: approx_def Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   627
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   628
lemma hypreal_minus_distrib1: "-(y + -(x::'a::ab_group_add)) = x + -y"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   629
by (simp add: add_commute)
14477
cc61fd03e589 conversion of Hyperreal/Lim to new-style
paulson
parents: 14468
diff changeset
   630
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   631
lemma approx_sym: "x @= y ==> y @= x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   632
apply (simp add: approx_def)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   633
apply (drule Infinitesimal_minus_iff [THEN iffD2])
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   634
apply simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   635
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   636
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   637
lemma approx_trans: "[| x @= y; y @= z |] ==> x @= z"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   638
apply (simp add: approx_def)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   639
apply (drule (1) Infinitesimal_add)
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   640
apply (simp add: diff_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   641
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   642
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   643
lemma approx_trans2: "[| r @= x; s @= x |] ==> r @= s"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   644
by (blast intro: approx_sym approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   645
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   646
lemma approx_trans3: "[| x @= r; x @= s|] ==> r @= s"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   647
by (blast intro: approx_sym approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   648
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   649
lemma number_of_approx_reorient: "(number_of w @= x) = (x @= number_of w)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   650
by (blast intro: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   651
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   652
lemma zero_approx_reorient: "(0 @= x) = (x @= 0)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   653
by (blast intro: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   654
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   655
lemma one_approx_reorient: "(1 @= x) = (x @= 1)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   656
by (blast intro: approx_sym)
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
   657
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
   658
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   659
ML {*
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   660
local
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   661
(*** re-orientation, following HOL/Integ/Bin.ML
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   662
     We re-orient x @=y where x is 0, 1 or a numeral, unless y is as well!
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   663
 ***)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   664
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   665
(*reorientation simprules using ==, for the following simproc*)
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   666
val meta_zero_approx_reorient = thm "zero_approx_reorient" RS eq_reflection;
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   667
val meta_one_approx_reorient = thm "one_approx_reorient" RS eq_reflection;
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   668
val meta_number_of_approx_reorient = thm "number_of_approx_reorient" RS eq_reflection
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   669
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   670
(*reorientation simplification procedure: reorients (polymorphic)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   671
  0 = x, 1 = x, nnn = x provided x isn't 0, 1 or a numeral.*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   672
fun reorient_proc sg _ (_ $ t $ u) =
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   673
  case u of
20713
823967ef47f1 renamed 0 and 1 to HOL.zero and HOL.one respectivly; introduced corresponding syntactic classes
haftmann
parents: 20652
diff changeset
   674
      Const("HOL.zero", _) => NONE
823967ef47f1 renamed 0 and 1 to HOL.zero and HOL.one respectivly; introduced corresponding syntactic classes
haftmann
parents: 20652
diff changeset
   675
    | Const("HOL.one", _) => NONE
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15251
diff changeset
   676
    | Const("Numeral.number_of", _) $ _ => NONE
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15251
diff changeset
   677
    | _ => SOME (case t of
20713
823967ef47f1 renamed 0 and 1 to HOL.zero and HOL.one respectivly; introduced corresponding syntactic classes
haftmann
parents: 20652
diff changeset
   678
                Const("HOL.zero", _) => meta_zero_approx_reorient
823967ef47f1 renamed 0 and 1 to HOL.zero and HOL.one respectivly; introduced corresponding syntactic classes
haftmann
parents: 20652
diff changeset
   679
              | Const("HOL.one", _) => meta_one_approx_reorient
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   680
              | Const("Numeral.number_of", _) $ _ =>
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   681
                                 meta_number_of_approx_reorient);
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   682
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   683
in
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   684
val approx_reorient_simproc =
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 20432
diff changeset
   685
  Int_Numeral_Base_Simprocs.prep_simproc
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   686
    ("reorient_simproc", ["0@=x", "1@=x", "number_of w @= x"], reorient_proc);
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17431
diff changeset
   687
end;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   688
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   689
Addsimprocs [approx_reorient_simproc];
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   690
*}
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   691
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   692
lemma Infinitesimal_approx_minus: "(x-y \<in> Infinitesimal) = (x @= y)"
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   693
by (simp add: approx_minus_iff [symmetric] mem_infmal_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   694
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   695
lemma approx_monad_iff: "(x @= y) = (monad(x)=monad(y))"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   696
apply (simp add: monad_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   697
apply (auto dest: approx_sym elim!: approx_trans equalityCE)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   698
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   699
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   700
lemma Infinitesimal_approx:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   701
     "[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> x @= y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   702
apply (simp add: mem_infmal_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   703
apply (blast intro: approx_trans approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   704
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   705
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   706
lemma approx_add: "[| a @= b; c @= d |] ==> a+c @= b+d"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   707
proof (unfold approx_def)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   708
  assume inf: "a - b \<in> Infinitesimal" "c - d \<in> Infinitesimal"
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   709
  have "a + c - (b + d) = (a - b) + (c - d)" by simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   710
  also have "... \<in> Infinitesimal" using inf by (rule Infinitesimal_add)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   711
  finally show "a + c - (b + d) \<in> Infinitesimal" .
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   712
qed
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   713
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   714
lemma approx_minus: "a @= b ==> -a @= -b"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   715
apply (rule approx_minus_iff [THEN iffD2, THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   716
apply (drule approx_minus_iff [THEN iffD1])
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   717
apply (simp add: add_commute diff_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   718
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   719
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   720
lemma approx_minus2: "-a @= -b ==> a @= b"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   721
by (auto dest: approx_minus)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   722
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   723
lemma approx_minus_cancel [simp]: "(-a @= -b) = (a @= b)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   724
by (blast intro: approx_minus approx_minus2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   725
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   726
lemma approx_add_minus: "[| a @= b; c @= d |] ==> a + -c @= b + -d"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   727
by (blast intro!: approx_add approx_minus)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   728
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
   729
lemma approx_diff: "[| a @= b; c @= d |] ==> a - c @= b - d"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
   730
by (simp only: diff_minus approx_add approx_minus)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
   731
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   732
lemma approx_mult1:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   733
  fixes a b c :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   734
  shows "[| a @= b; c: HFinite|] ==> a*c @= b*c"
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   735
by (simp add: approx_def Infinitesimal_HFinite_mult
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   736
              left_diff_distrib [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   737
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   738
lemma approx_mult2:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   739
  fixes a b c :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   740
  shows "[|a @= b; c: HFinite|] ==> c*a @= c*b"
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   741
by (simp add: approx_def Infinitesimal_HFinite_mult2
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   742
              right_diff_distrib [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   743
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   744
lemma approx_mult_subst:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   745
  fixes u v x y :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   746
  shows "[|u @= v*x; x @= y; v \<in> HFinite|] ==> u @= v*y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   747
by (blast intro: approx_mult2 approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   748
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   749
lemma approx_mult_subst2:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   750
  fixes u v x y :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   751
  shows "[| u @= x*v; x @= y; v \<in> HFinite |] ==> u @= y*v"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   752
by (blast intro: approx_mult1 approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   753
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   754
lemma approx_mult_subst_star_of:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   755
  fixes u x y :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   756
  shows "[| u @= x*star_of v; x @= y |] ==> u @= y*star_of v"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   757
by (auto intro: approx_mult_subst2)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   758
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   759
lemma approx_eq_imp: "a = b ==> a @= b"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   760
by (simp add: approx_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   761
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   762
lemma Infinitesimal_minus_approx: "x \<in> Infinitesimal ==> -x @= x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   763
by (blast intro: Infinitesimal_minus_iff [THEN iffD2] 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   764
                    mem_infmal_iff [THEN iffD1] approx_trans2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   765
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
   766
lemma bex_Infinitesimal_iff: "(\<exists>y \<in> Infinitesimal. x - z = y) = (x @= z)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   767
by (simp add: approx_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   768
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   769
lemma bex_Infinitesimal_iff2: "(\<exists>y \<in> Infinitesimal. x = z + y) = (x @= z)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   770
by (force simp add: bex_Infinitesimal_iff [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   771
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   772
lemma Infinitesimal_add_approx: "[| y \<in> Infinitesimal; x + y = z |] ==> x @= z"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   773
apply (rule bex_Infinitesimal_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   774
apply (drule Infinitesimal_minus_iff [THEN iffD2])
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   775
apply (auto simp add: add_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   776
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   777
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   778
lemma Infinitesimal_add_approx_self: "y \<in> Infinitesimal ==> x @= x + y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   779
apply (rule bex_Infinitesimal_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   780
apply (drule Infinitesimal_minus_iff [THEN iffD2])
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   781
apply (auto simp add: add_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   782
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   783
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   784
lemma Infinitesimal_add_approx_self2: "y \<in> Infinitesimal ==> x @= y + x"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   785
by (auto dest: Infinitesimal_add_approx_self simp add: add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   786
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   787
lemma Infinitesimal_add_minus_approx_self: "y \<in> Infinitesimal ==> x @= x + -y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   788
by (blast intro!: Infinitesimal_add_approx_self Infinitesimal_minus_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   789
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   790
lemma Infinitesimal_add_cancel: "[| y \<in> Infinitesimal; x+y @= z|] ==> x @= z"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   791
apply (drule_tac x = x in Infinitesimal_add_approx_self [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   792
apply (erule approx_trans3 [THEN approx_sym], assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   793
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   794
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   795
lemma Infinitesimal_add_right_cancel:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   796
     "[| y \<in> Infinitesimal; x @= z + y|] ==> x @= z"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   797
apply (drule_tac x = z in Infinitesimal_add_approx_self2 [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   798
apply (erule approx_trans3 [THEN approx_sym])
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   799
apply (simp add: add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   800
apply (erule approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   801
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   802
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   803
lemma approx_add_left_cancel: "d + b  @= d + c ==> b @= c"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   804
apply (drule approx_minus_iff [THEN iffD1])
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
   805
apply (simp add: approx_minus_iff [symmetric] add_ac)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   806
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   807
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   808
lemma approx_add_right_cancel: "b + d @= c + d ==> b @= c"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   809
apply (rule approx_add_left_cancel)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   810
apply (simp add: add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   811
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   812
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   813
lemma approx_add_mono1: "b @= c ==> d + b @= d + c"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   814
apply (rule approx_minus_iff [THEN iffD2])
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
   815
apply (simp add: approx_minus_iff [symmetric] add_ac)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   816
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   817
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   818
lemma approx_add_mono2: "b @= c ==> b + a @= c + a"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   819
by (simp add: add_commute approx_add_mono1)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   820
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   821
lemma approx_add_left_iff [simp]: "(a + b @= a + c) = (b @= c)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   822
by (fast elim: approx_add_left_cancel approx_add_mono1)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   823
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   824
lemma approx_add_right_iff [simp]: "(b + a @= c + a) = (b @= c)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   825
by (simp add: add_commute)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   826
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   827
lemma approx_HFinite: "[| x \<in> HFinite; x @= y |] ==> y \<in> HFinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   828
apply (drule bex_Infinitesimal_iff2 [THEN iffD2], safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   829
apply (drule Infinitesimal_subset_HFinite [THEN subsetD, THEN HFinite_minus_iff [THEN iffD2]])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   830
apply (drule HFinite_add)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   831
apply (auto simp add: add_assoc)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   832
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   833
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   834
lemma approx_star_of_HFinite: "x @= star_of D ==> x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   835
by (rule approx_sym [THEN [2] approx_HFinite], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   836
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   837
lemma approx_mult_HFinite:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   838
  fixes a b c d :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   839
  shows "[|a @= b; c @= d; b: HFinite; d: HFinite|] ==> a*c @= b*d"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   840
apply (rule approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   841
apply (rule_tac [2] approx_mult2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   842
apply (rule approx_mult1)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   843
prefer 2 apply (blast intro: approx_HFinite approx_sym, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   844
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   845
20794
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   846
lemma scaleHR_left_diff_distrib:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   847
  "\<And>a b x. scaleHR (a - b) x = scaleHR a x - scaleHR b x"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   848
by transfer (rule scaleR_left_diff_distrib)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   849
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   850
lemma approx_scaleR1:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   851
  "[| a @= star_of b; c: HFinite|] ==> scaleHR a c @= b *# c"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   852
apply (unfold approx_def)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   853
apply (drule (1) Infinitesimal_HFinite_scaleHR)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   854
apply (simp only: scaleHR_left_diff_distrib)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   855
apply (simp add: scaleHR_def star_scaleR_def [symmetric])
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   856
done
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   857
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   858
lemma approx_scaleR2:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   859
  "a @= b ==> c *# a @= c *# b"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   860
by (simp add: approx_def Infinitesimal_scaleR2
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   861
              scaleR_right_diff_distrib [symmetric])
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   862
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   863
lemma approx_scaleR_HFinite:
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   864
  "[|a @= star_of b; c @= d; d: HFinite|] ==> scaleHR a c @= b *# d"
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   865
apply (rule approx_trans)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   866
apply (rule_tac [2] approx_scaleR2)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   867
apply (rule approx_scaleR1)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   868
prefer 2 apply (blast intro: approx_HFinite approx_sym, auto)
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   869
done
02482f9501ac add scaleR lemmas
huffman
parents: 20749
diff changeset
   870
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   871
lemma approx_mult_star_of:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   872
  fixes a c :: "'a::real_normed_algebra star"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   873
  shows "[|a @= star_of b; c @= star_of d |]
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   874
      ==> a*c @= star_of b*star_of d"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   875
by (blast intro!: approx_mult_HFinite approx_star_of_HFinite HFinite_star_of)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   876
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   877
lemma approx_SReal_mult_cancel_zero:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   878
     "[| (a::hypreal) \<in> Reals; a \<noteq> 0; a*x @= 0 |] ==> x @= 0"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   879
apply (drule Reals_inverse [THEN SReal_subset_HFinite [THEN subsetD]])
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   880
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   881
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   882
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   883
lemma approx_mult_SReal1: "[| (a::hypreal) \<in> Reals; x @= 0 |] ==> x*a @= 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   884
by (auto dest: SReal_subset_HFinite [THEN subsetD] approx_mult1)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   885
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   886
lemma approx_mult_SReal2: "[| (a::hypreal) \<in> Reals; x @= 0 |] ==> a*x @= 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   887
by (auto dest: SReal_subset_HFinite [THEN subsetD] approx_mult2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   888
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   889
lemma approx_mult_SReal_zero_cancel_iff [simp]:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   890
     "[|(a::hypreal) \<in> Reals; a \<noteq> 0 |] ==> (a*x @= 0) = (x @= 0)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   891
by (blast intro: approx_SReal_mult_cancel_zero approx_mult_SReal2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   892
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   893
lemma approx_SReal_mult_cancel:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   894
     "[| (a::hypreal) \<in> Reals; a \<noteq> 0; a* w @= a*z |] ==> w @= z"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   895
apply (drule Reals_inverse [THEN SReal_subset_HFinite [THEN subsetD]])
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
   896
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   897
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   898
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   899
lemma approx_SReal_mult_cancel_iff1 [simp]:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   900
     "[| (a::hypreal) \<in> Reals; a \<noteq> 0|] ==> (a* w @= a*z) = (w @= z)"
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   901
by (auto intro!: approx_mult2 SReal_subset_HFinite [THEN subsetD]
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   902
         intro: approx_SReal_mult_cancel)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   903
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   904
lemma approx_le_bound: "[| (z::hypreal) \<le> f; f @= g; g \<le> z |] ==> f @= z"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   905
apply (simp add: bex_Infinitesimal_iff2 [symmetric], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   906
apply (rule_tac x = "g+y-z" in bexI)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   907
apply (simp (no_asm))
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   908
apply (rule Infinitesimal_interval2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   909
apply (rule_tac [2] Infinitesimal_zero, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   910
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   911
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   912
lemma approx_hnorm:
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   913
  fixes x y :: "'a::real_normed_vector star"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   914
  shows "x \<approx> y \<Longrightarrow> hnorm x \<approx> hnorm y"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   915
proof (unfold approx_def)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   916
  assume "x - y \<in> Infinitesimal"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   917
  hence 1: "hnorm (x - y) \<in> Infinitesimal"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   918
    by (simp only: Infinitesimal_hnorm_iff)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   919
  moreover have 2: "(0::real star) \<in> Infinitesimal"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   920
    by (rule Infinitesimal_zero)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   921
  moreover have 3: "0 \<le> \<bar>hnorm x - hnorm y\<bar>"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   922
    by (rule abs_ge_zero)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   923
  moreover have 4: "\<bar>hnorm x - hnorm y\<bar> \<le> hnorm (x - y)"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   924
    by (rule hnorm_triangle_ineq3)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   925
  ultimately have "\<bar>hnorm x - hnorm y\<bar> \<in> Infinitesimal"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   926
    by (rule Infinitesimal_interval2)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   927
  thus "hnorm x - hnorm y \<in> Infinitesimal"
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   928
    by (simp only: Infinitesimal_hrabs_iff)
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   929
qed
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
   930
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   931
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
   932
subsection{* Zero is the Only Infinitesimal that is also a Real*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   933
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   934
lemma Infinitesimal_less_SReal:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   935
     "[| (x::hypreal) \<in> Reals; y \<in> Infinitesimal; 0 < x |] ==> y < x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   936
apply (simp add: Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   937
apply (rule abs_ge_self [THEN order_le_less_trans], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   938
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   939
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   940
lemma Infinitesimal_less_SReal2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   941
     "(y::hypreal) \<in> Infinitesimal ==> \<forall>r \<in> Reals. 0 < r --> y < r"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   942
by (blast intro: Infinitesimal_less_SReal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   943
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   944
lemma SReal_not_Infinitesimal:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   945
     "[| 0 < y;  (y::hypreal) \<in> Reals|] ==> y \<notin> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   946
apply (simp add: Infinitesimal_def)
15003
6145dd7538d7 replaced monomorphic abs definitions by abs_if
paulson
parents: 14653
diff changeset
   947
apply (auto simp add: abs_if)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   948
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   949
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   950
lemma SReal_minus_not_Infinitesimal:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   951
     "[| y < 0;  (y::hypreal) \<in> Reals |] ==> y \<notin> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   952
apply (subst Infinitesimal_minus_iff [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   953
apply (rule SReal_not_Infinitesimal, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   954
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   955
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   956
lemma SReal_Int_Infinitesimal_zero: "Reals Int Infinitesimal = {0::hypreal}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   957
apply auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   958
apply (cut_tac x = x and y = 0 in linorder_less_linear)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   959
apply (blast dest: SReal_not_Infinitesimal SReal_minus_not_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   960
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   961
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   962
lemma SReal_Infinitesimal_zero:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   963
  "[| (x::hypreal) \<in> Reals; x \<in> Infinitesimal|] ==> x = 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   964
by (cut_tac SReal_Int_Infinitesimal_zero, blast)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   965
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   966
lemma SReal_HFinite_diff_Infinitesimal:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   967
     "[| (x::hypreal) \<in> Reals; x \<noteq> 0 |] ==> x \<in> HFinite - Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   968
by (auto dest: SReal_Infinitesimal_zero SReal_subset_HFinite [THEN subsetD])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   969
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   970
lemma hypreal_of_real_HFinite_diff_Infinitesimal:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
   971
     "hypreal_of_real x \<noteq> 0 ==> hypreal_of_real x \<in> HFinite - Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   972
by (rule SReal_HFinite_diff_Infinitesimal, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   973
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   974
lemma star_of_Infinitesimal_iff_0 [iff]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   975
  "(star_of x \<in> Infinitesimal) = (x = 0)"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   976
apply (auto simp add: Infinitesimal_def)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   977
apply (drule_tac x="hnorm (star_of x)" in bspec)
20728
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
   978
apply (simp add: SReal_def)
8d21108bc6dd move star_of_norm from SEQ.thy to NSA.thy
huffman
parents: 20723
diff changeset
   979
apply (rule_tac x="norm x" in exI, simp)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   980
apply simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   981
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   982
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   983
lemma star_of_HFinite_diff_Infinitesimal:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   984
     "x \<noteq> 0 ==> star_of x \<in> HFinite - Infinitesimal"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   985
by simp
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   986
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
   987
lemma number_of_not_Infinitesimal [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   988
     "number_of w \<noteq> (0::hypreal) ==> (number_of w :: hypreal) \<notin> Infinitesimal"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
   989
by (fast dest: Reals_number_of [THEN SReal_Infinitesimal_zero])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   990
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   991
(*again: 1 is a special case, but not 0 this time*)
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   992
lemma one_not_Infinitesimal [simp]:
20633
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20584
diff changeset
   993
  "(1::'a::{real_normed_vector,zero_neq_one} star) \<notin> Infinitesimal"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   994
apply (simp only: star_one_def star_of_Infinitesimal_iff_0)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
   995
apply simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   996
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
   997
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   998
lemma approx_SReal_not_zero:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
   999
  "[| (y::hypreal) \<in> Reals; x @= y; y\<noteq> 0 |] ==> x \<noteq> 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1000
apply (cut_tac x = 0 and y = y in linorder_less_linear, simp)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1001
apply (blast dest: approx_sym [THEN mem_infmal_iff [THEN iffD2]] SReal_not_Infinitesimal SReal_minus_not_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1002
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1003
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1004
lemma HFinite_diff_Infinitesimal_approx:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1005
     "[| x @= y; y \<in> HFinite - Infinitesimal |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1006
      ==> x \<in> HFinite - Infinitesimal"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1007
apply (auto intro: approx_sym [THEN [2] approx_HFinite]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1008
            simp add: mem_infmal_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1009
apply (drule approx_trans3, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1010
apply (blast dest: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1011
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1012
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1013
(*The premise y\<noteq>0 is essential; otherwise x/y =0 and we lose the
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1014
  HFinite premise.*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1015
lemma Infinitesimal_ratio:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1016
  fixes x y :: "'a::{real_normed_div_algebra,field} star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1017
  shows "[| y \<noteq> 0;  y \<in> Infinitesimal;  x/y \<in> HFinite |]
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1018
         ==> x \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1019
apply (drule Infinitesimal_HFinite_mult2, assumption)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1020
apply (simp add: divide_inverse mult_assoc)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1021
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1022
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1023
lemma Infinitesimal_SReal_divide: 
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1024
  "[| (x::hypreal) \<in> Infinitesimal; y \<in> Reals |] ==> x/y \<in> Infinitesimal"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14420
diff changeset
  1025
apply (simp add: divide_inverse)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1026
apply (auto intro!: Infinitesimal_HFinite_mult 
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1027
            dest!: Reals_inverse [THEN SReal_subset_HFinite [THEN subsetD]])
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1028
done
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1029
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1030
(*------------------------------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1031
       Standard Part Theorem: Every finite x: R* is infinitely
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1032
       close to a unique real number (i.e a member of Reals)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1033
 ------------------------------------------------------------------*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1034
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1035
subsection{* Uniqueness: Two Infinitely Close Reals are Equal*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1036
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1037
lemma star_of_approx_iff [simp]: "(star_of x @= star_of y) = (x = y)"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1038
apply safe
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1039
apply (simp add: approx_def)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1040
apply (simp only: star_of_diff [symmetric])
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1041
apply (simp only: star_of_Infinitesimal_iff_0)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1042
apply simp
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1043
done
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1044
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1045
lemma SReal_approx_iff:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1046
  "[|(x::hypreal) \<in> Reals; y \<in> Reals|] ==> (x @= y) = (x = y)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1047
apply auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1048
apply (simp add: approx_def)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1049
apply (drule (1) Reals_diff)
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1050
apply (drule (1) SReal_Infinitesimal_zero)
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1051
apply simp
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1052
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1053
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1054
lemma number_of_approx_iff [simp]:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1055
     "(number_of v @= (number_of w :: 'a::{number,real_normed_vector} star)) =
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1056
      (number_of v = (number_of w :: 'a))"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1057
apply (unfold star_number_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1058
apply (rule star_of_approx_iff)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1059
done
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1060
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1061
(*And also for 0 @= #nn and 1 @= #nn, #nn @= 0 and #nn @= 1.*)
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1062
lemma [simp]:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1063
  "(number_of w @= (0::'a::{number,real_normed_vector} star)) =
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1064
   (number_of w = (0::'a))"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1065
  "((0::'a::{number,real_normed_vector} star) @= number_of w) =
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1066
   (number_of w = (0::'a))"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1067
  "(number_of w @= (1::'b::{number,one,real_normed_vector} star)) =
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1068
   (number_of w = (1::'b))"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1069
  "((1::'b::{number,one,real_normed_vector} star) @= number_of w) =
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1070
   (number_of w = (1::'b))"
20633
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20584
diff changeset
  1071
  "~ (0 @= (1::'c::{zero_neq_one,real_normed_vector} star))"
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20584
diff changeset
  1072
  "~ (1 @= (0::'c::{zero_neq_one,real_normed_vector} star))"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1073
apply (unfold star_number_def star_zero_def star_one_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1074
apply (unfold star_of_approx_iff)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1075
by (auto intro: sym)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1076
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1077
lemma star_of_approx_number_of_iff [simp]:
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1078
     "(star_of k @= number_of w) = (k = number_of w)"
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1079
by (subst star_of_approx_iff [symmetric], auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1080
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1081
lemma star_of_approx_zero_iff [simp]: "(star_of k @= 0) = (k = 0)"
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1082
by (simp_all add: star_of_approx_iff [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1083
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1084
lemma star_of_approx_one_iff [simp]: "(star_of k @= 1) = (k = 1)"
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1085
by (simp_all add: star_of_approx_iff [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1086
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1087
lemma approx_unique_real:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1088
     "[| (r::hypreal) \<in> Reals; s \<in> Reals; r @= x; s @= x|] ==> r = s"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1089
by (blast intro: SReal_approx_iff [THEN iffD1] approx_trans2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1090
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1091
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1092
subsection{* Existence of Unique Real Infinitely Close*}
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1093
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1094
subsubsection{*Lifting of the Ub and Lub Properties*}
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1095
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1096
lemma hypreal_of_real_isUb_iff:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1097
      "(isUb (Reals) (hypreal_of_real ` Q) (hypreal_of_real Y)) =
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1098
       (isUb (UNIV :: real set) Q Y)"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1099
by (simp add: isUb_def setle_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1100
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1101
lemma hypreal_of_real_isLub1:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1102
     "isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1103
      ==> isLub (UNIV :: real set) Q Y"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1104
apply (simp add: isLub_def leastP_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1105
apply (auto intro: hypreal_of_real_isUb_iff [THEN iffD2]
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1106
            simp add: hypreal_of_real_isUb_iff setge_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1107
done
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1108
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1109
lemma hypreal_of_real_isLub2:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1110
      "isLub (UNIV :: real set) Q Y
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1111
       ==> isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y)"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1112
apply (simp add: isLub_def leastP_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1113
apply (auto simp add: hypreal_of_real_isUb_iff setge_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1114
apply (frule_tac x2 = x in isUbD2a [THEN SReal_iff [THEN iffD1], THEN exE])
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1115
 prefer 2 apply assumption
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1116
apply (drule_tac x = xa in spec)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1117
apply (auto simp add: hypreal_of_real_isUb_iff)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1118
done
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1119
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1120
lemma hypreal_of_real_isLub_iff:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1121
     "(isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y)) =
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1122
      (isLub (UNIV :: real set) Q Y)"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1123
by (blast intro: hypreal_of_real_isLub1 hypreal_of_real_isLub2)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1124
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1125
lemma lemma_isUb_hypreal_of_real:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1126
     "isUb Reals P Y ==> \<exists>Yo. isUb Reals P (hypreal_of_real Yo)"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1127
by (auto simp add: SReal_iff isUb_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1128
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1129
lemma lemma_isLub_hypreal_of_real:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1130
     "isLub Reals P Y ==> \<exists>Yo. isLub Reals P (hypreal_of_real Yo)"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1131
by (auto simp add: isLub_def leastP_def isUb_def SReal_iff)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1132
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1133
lemma lemma_isLub_hypreal_of_real2:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1134
     "\<exists>Yo. isLub Reals P (hypreal_of_real Yo) ==> \<exists>Y. isLub Reals P Y"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1135
by (auto simp add: isLub_def leastP_def isUb_def)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1136
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1137
lemma SReal_complete:
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1138
     "[| P \<subseteq> Reals;  \<exists>x. x \<in> P;  \<exists>Y. isUb Reals P Y |]
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1139
      ==> \<exists>t::hypreal. isLub Reals P t"
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1140
apply (frule SReal_hypreal_of_real_image)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1141
apply (auto, drule lemma_isUb_hypreal_of_real)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1142
apply (auto intro!: reals_complete lemma_isLub_hypreal_of_real2
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1143
            simp add: hypreal_of_real_isLub_iff hypreal_of_real_isUb_iff)
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1144
done
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1145
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1146
(* lemma about lubs *)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1147
lemma hypreal_isLub_unique:
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1148
     "[| isLub R S x; isLub R S y |] ==> x = (y::hypreal)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1149
apply (frule isLub_isUb)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1150
apply (frule_tac x = y in isLub_isUb)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1151
apply (blast intro!: order_antisym dest!: isLub_le_isUb)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1152
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1153
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1154
lemma lemma_st_part_ub:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1155
     "(x::hypreal) \<in> HFinite ==> \<exists>u. isUb Reals {s. s \<in> Reals & s < x} u"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1156
apply (drule HFiniteD, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1157
apply (rule exI, rule isUbI)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1158
apply (auto intro: setleI isUbI simp add: abs_less_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1159
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1160
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1161
lemma lemma_st_part_nonempty:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1162
  "(x::hypreal) \<in> HFinite ==> \<exists>y. y \<in> {s. s \<in> Reals & s < x}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1163
apply (drule HFiniteD, safe)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1164
apply (drule Reals_minus)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1165
apply (rule_tac x = "-t" in exI)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1166
apply (auto simp add: abs_less_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1167
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1168
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1169
lemma lemma_st_part_subset: "{s. s \<in> Reals & s < x} \<subseteq> Reals"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1170
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1171
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1172
lemma lemma_st_part_lub:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1173
     "(x::hypreal) \<in> HFinite ==> \<exists>t. isLub Reals {s. s \<in> Reals & s < x} t"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1174
by (blast intro!: SReal_complete lemma_st_part_ub lemma_st_part_nonempty lemma_st_part_subset)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1175
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1176
lemma lemma_hypreal_le_left_cancel: "((t::hypreal) + r \<le> t) = (r \<le> 0)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1177
apply safe
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1178
apply (drule_tac c = "-t" in add_left_mono)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1179
apply (drule_tac [2] c = t in add_left_mono)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1180
apply (auto simp add: add_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1181
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1182
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1183
lemma lemma_st_part_le1:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1184
     "[| (x::hypreal) \<in> HFinite;  isLub Reals {s. s \<in> Reals & s < x} t;
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1185
         r \<in> Reals;  0 < r |] ==> x \<le> t + r"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1186
apply (frule isLubD1a)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1187
apply (rule ccontr, drule linorder_not_le [THEN iffD2])
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1188
apply (drule (1) Reals_add)
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1189
apply (drule_tac y = "r + t" in isLubD1 [THEN setleD], auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1190
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1191
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1192
lemma hypreal_setle_less_trans:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1193
     "[| S *<= (x::hypreal); x < y |] ==> S *<= y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1194
apply (simp add: setle_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1195
apply (auto dest!: bspec order_le_less_trans intro: order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1196
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1197
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1198
lemma hypreal_gt_isUb:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1199
     "[| isUb R S (x::hypreal); x < y; y \<in> R |] ==> isUb R S y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1200
apply (simp add: isUb_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1201
apply (blast intro: hypreal_setle_less_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1202
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1203
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1204
lemma lemma_st_part_gt_ub:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1205
     "[| (x::hypreal) \<in> HFinite; x < y; y \<in> Reals |]
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1206
      ==> isUb Reals {s. s \<in> Reals & s < x} y"
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1207
by (auto dest: order_less_trans intro: order_less_imp_le intro!: isUbI setleI)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1208
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1209
lemma lemma_minus_le_zero: "t \<le> t + -r ==> r \<le> (0::hypreal)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1210
apply (drule_tac c = "-t" in add_left_mono)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1211
apply (auto simp add: add_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1212
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1213
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1214
lemma lemma_st_part_le2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1215
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1216
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1217
         r \<in> Reals; 0 < r |]
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1218
      ==> t + -r \<le> x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1219
apply (frule isLubD1a)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1220
apply (rule ccontr, drule linorder_not_le [THEN iffD1])
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1221
apply (drule Reals_minus, drule_tac a = t in Reals_add, assumption)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1222
apply (drule lemma_st_part_gt_ub, assumption+)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1223
apply (drule isLub_le_isUb, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1224
apply (drule lemma_minus_le_zero)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1225
apply (auto dest: order_less_le_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1226
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1227
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1228
lemma lemma_st_part1a:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1229
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1230
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1231
         r \<in> Reals; 0 < r |]
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1232
      ==> x + -t \<le> r"
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1233
apply (subgoal_tac "x \<le> t+r") 
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1234
apply (auto intro: lemma_st_part_le1)
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1235
done
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1236
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1237
lemma lemma_st_part2a:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1238
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1239
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1240
         r \<in> Reals;  0 < r |]
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1241
      ==> -(x + -t) \<le> r"
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1242
apply (subgoal_tac "(t + -r \<le> x)") 
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1243
apply (auto intro: lemma_st_part_le2)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1244
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1245
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1246
lemma lemma_SReal_ub:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1247
     "(x::hypreal) \<in> Reals ==> isUb Reals {s. s \<in> Reals & s < x} x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1248
by (auto intro: isUbI setleI order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1249
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1250
lemma lemma_SReal_lub:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1251
     "(x::hypreal) \<in> Reals ==> isLub Reals {s. s \<in> Reals & s < x} x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1252
apply (auto intro!: isLubI2 lemma_SReal_ub setgeI)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1253
apply (frule isUbD2a)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1254
apply (rule_tac x = x and y = y in linorder_cases)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1255
apply (auto intro!: order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1256
apply (drule SReal_dense, assumption, assumption, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1257
apply (drule_tac y = r in isUbD)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1258
apply (auto dest: order_less_le_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1259
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1260
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1261
lemma lemma_st_part_not_eq1:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1262
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1263
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1264
         r \<in> Reals; 0 < r |]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1265
      ==> x + -t \<noteq> r"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1266
apply auto
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1267
apply (frule isLubD1a [THEN Reals_minus])
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1268
apply (drule Reals_add_cancel, assumption)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1269
apply (drule_tac x = x in lemma_SReal_lub)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1270
apply (drule hypreal_isLub_unique, assumption, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1271
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1272
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1273
lemma lemma_st_part_not_eq2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1274
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1275
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1276
         r \<in> Reals; 0 < r |]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1277
      ==> -(x + -t) \<noteq> r"
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
  1278
apply (auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1279
apply (frule isLubD1a)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1280
apply (drule Reals_add_cancel, assumption)
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1281
apply (drule_tac a = "-x" in Reals_minus, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1282
apply (drule_tac x = x in lemma_SReal_lub)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1283
apply (drule hypreal_isLub_unique, assumption, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1284
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1285
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1286
lemma lemma_st_part_major:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1287
     "[| (x::hypreal) \<in> HFinite;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1288
         isLub Reals {s. s \<in> Reals & s < x} t;
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1289
         r \<in> Reals; 0 < r |]
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1290
      ==> abs (x - t) < r"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1291
apply (frule lemma_st_part1a)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1292
apply (frule_tac [4] lemma_st_part2a, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1293
apply (drule order_le_imp_less_or_eq)+
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1294
apply (auto dest: lemma_st_part_not_eq1 lemma_st_part_not_eq2 simp add: abs_less_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1295
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1296
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1297
lemma lemma_st_part_major2:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1298
     "[| (x::hypreal) \<in> HFinite; isLub Reals {s. s \<in> Reals & s < x} t |]
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1299
      ==> \<forall>r \<in> Reals. 0 < r --> abs (x - t) < r"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1300
by (blast dest!: lemma_st_part_major)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1301
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1302
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1303
text{*Existence of real and Standard Part Theorem*}
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1304
lemma lemma_st_part_Ex:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1305
     "(x::hypreal) \<in> HFinite
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1306
       ==> \<exists>t \<in> Reals. \<forall>r \<in> Reals. 0 < r --> abs (x - t) < r"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1307
apply (frule lemma_st_part_lub, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1308
apply (frule isLubD1a)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1309
apply (blast dest: lemma_st_part_major2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1310
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1311
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1312
lemma st_part_Ex:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1313
     "(x::hypreal) \<in> HFinite ==> \<exists>t \<in> Reals. x @= t"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1314
apply (simp add: approx_def Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1315
apply (drule lemma_st_part_Ex, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1316
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1317
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1318
text{*There is a unique real infinitely close*}
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1319
lemma st_part_Ex1: "x \<in> HFinite ==> EX! t::hypreal. t \<in> Reals & x @= t"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1320
apply (drule st_part_Ex, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1321
apply (drule_tac [2] approx_sym, drule_tac [2] approx_sym, drule_tac [2] approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1322
apply (auto intro!: approx_unique_real)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1323
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1324
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1325
subsection{* Finite, Infinite and Infinitesimal*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1326
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1327
lemma HFinite_Int_HInfinite_empty [simp]: "HFinite Int HInfinite = {}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1328
apply (simp add: HFinite_def HInfinite_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1329
apply (auto dest: order_less_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1330
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1331
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1332
lemma HFinite_not_HInfinite: 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1333
  assumes x: "x \<in> HFinite" shows "x \<notin> HInfinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1334
proof
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1335
  assume x': "x \<in> HInfinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1336
  with x have "x \<in> HFinite \<inter> HInfinite" by blast
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1337
  thus False by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1338
qed
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1339
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1340
lemma not_HFinite_HInfinite: "x\<notin> HFinite ==> x \<in> HInfinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1341
apply (simp add: HInfinite_def HFinite_def, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1342
apply (drule_tac x = "r + 1" in bspec)
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
  1343
apply (auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1344
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1345
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1346
lemma HInfinite_HFinite_disj: "x \<in> HInfinite | x \<in> HFinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1347
by (blast intro: not_HFinite_HInfinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1348
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1349
lemma HInfinite_HFinite_iff: "(x \<in> HInfinite) = (x \<notin> HFinite)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1350
by (blast dest: HFinite_not_HInfinite not_HFinite_HInfinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1351
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1352
lemma HFinite_HInfinite_iff: "(x \<in> HFinite) = (x \<notin> HInfinite)"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1353
by (simp add: HInfinite_HFinite_iff)
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1354
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1355
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1356
lemma HInfinite_diff_HFinite_Infinitesimal_disj:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1357
     "x \<notin> Infinitesimal ==> x \<in> HInfinite | x \<in> HFinite - Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1358
by (fast intro: not_HFinite_HInfinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1359
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1360
lemma HFinite_inverse:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1361
  fixes x :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1362
  shows "[| x \<in> HFinite; x \<notin> Infinitesimal |] ==> inverse x \<in> HFinite"
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1363
apply (subgoal_tac "x \<noteq> 0")
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1364
apply (cut_tac x = "inverse x" in HInfinite_HFinite_disj)
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1365
apply (auto dest!: HInfinite_inverse_Infinitesimal
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1366
            simp add: nonzero_inverse_inverse_eq)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1367
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1368
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1369
lemma HFinite_inverse2:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1370
  fixes x :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1371
  shows "x \<in> HFinite - Infinitesimal ==> inverse x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1372
by (blast intro: HFinite_inverse)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1373
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1374
(* stronger statement possible in fact *)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1375
lemma Infinitesimal_inverse_HFinite:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1376
  fixes x :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1377
  shows "x \<notin> Infinitesimal ==> inverse(x) \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1378
apply (drule HInfinite_diff_HFinite_Infinitesimal_disj)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1379
apply (blast intro: HFinite_inverse HInfinite_inverse_Infinitesimal Infinitesimal_subset_HFinite [THEN subsetD])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1380
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1381
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1382
lemma HFinite_not_Infinitesimal_inverse:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1383
  fixes x :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1384
  shows "x \<in> HFinite - Infinitesimal ==> inverse x \<in> HFinite - Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1385
apply (auto intro: Infinitesimal_inverse_HFinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1386
apply (drule Infinitesimal_HFinite_mult2, assumption)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1387
apply (simp add: not_Infinitesimal_not_zero right_inverse)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1388
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1389
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1390
lemma approx_inverse:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1391
  fixes x y :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1392
  shows
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1393
     "[| x @= y; y \<in>  HFinite - Infinitesimal |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1394
      ==> inverse x @= inverse y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1395
apply (frule HFinite_diff_Infinitesimal_approx, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1396
apply (frule not_Infinitesimal_not_zero2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1397
apply (frule_tac x = x in not_Infinitesimal_not_zero2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1398
apply (drule HFinite_inverse2)+
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1399
apply (drule approx_mult2, assumption, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1400
apply (drule_tac c = "inverse x" in approx_mult1, assumption)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1401
apply (auto intro: approx_sym simp add: mult_assoc)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1402
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1403
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1404
(*Used for NSLIM_inverse, NSLIMSEQ_inverse*)
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1405
lemmas star_of_approx_inverse = star_of_HFinite_diff_Infinitesimal [THEN [2] approx_inverse]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1406
lemmas hypreal_of_real_approx_inverse =  hypreal_of_real_HFinite_diff_Infinitesimal [THEN [2] approx_inverse]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1407
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1408
lemma inverse_add_Infinitesimal_approx:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1409
  fixes x h :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1410
  shows
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1411
     "[| x \<in> HFinite - Infinitesimal;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1412
         h \<in> Infinitesimal |] ==> inverse(x + h) @= inverse x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1413
apply (auto intro: approx_inverse approx_sym Infinitesimal_add_approx_self)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1414
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1415
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1416
lemma inverse_add_Infinitesimal_approx2:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1417
  fixes x h :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1418
  shows
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1419
     "[| x \<in> HFinite - Infinitesimal;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1420
         h \<in> Infinitesimal |] ==> inverse(h + x) @= inverse x"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1421
apply (rule add_commute [THEN subst])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1422
apply (blast intro: inverse_add_Infinitesimal_approx)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1423
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1424
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1425
lemma inverse_add_Infinitesimal_approx_Infinitesimal:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1426
  fixes x h :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1427
  shows
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1428
     "[| x \<in> HFinite - Infinitesimal;
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1429
         h \<in> Infinitesimal |] ==> inverse(x + h) - inverse x @= h"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1430
apply (rule approx_trans2)
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1431
apply (auto intro: inverse_add_Infinitesimal_approx 
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1432
            simp add: mem_infmal_iff approx_minus_iff [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1433
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1434
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1435
lemma Infinitesimal_square_iff:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1436
  fixes x :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1437
  shows "(x \<in> Infinitesimal) = (x*x \<in> Infinitesimal)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1438
apply (auto intro: Infinitesimal_mult)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1439
apply (rule ccontr, frule Infinitesimal_inverse_HFinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1440
apply (frule not_Infinitesimal_not_zero)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1441
apply (auto dest: Infinitesimal_HFinite_mult simp add: mult_assoc)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1442
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1443
declare Infinitesimal_square_iff [symmetric, simp]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1444
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1445
lemma HFinite_square_iff [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1446
  fixes x :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1447
  shows "(x*x \<in> HFinite) = (x \<in> HFinite)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1448
apply (auto intro: HFinite_mult)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1449
apply (auto dest: HInfinite_mult simp add: HFinite_HInfinite_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1450
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1451
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1452
lemma HInfinite_square_iff [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1453
  fixes x :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1454
  shows "(x*x \<in> HInfinite) = (x \<in> HInfinite)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1455
by (auto simp add: HInfinite_HFinite_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1456
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1457
lemma approx_HFinite_mult_cancel:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1458
  fixes a w z :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1459
  shows "[| a: HFinite-Infinitesimal; a* w @= a*z |] ==> w @= z"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1460
apply safe
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1461
apply (frule HFinite_inverse, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1462
apply (drule not_Infinitesimal_not_zero)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1463
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1464
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1465
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1466
lemma approx_HFinite_mult_cancel_iff1:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1467
  fixes a w z :: "'a::real_normed_div_algebra star"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1468
  shows "a: HFinite-Infinitesimal ==> (a * w @= a * z) = (w @= z)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1469
by (auto intro: approx_mult2 approx_HFinite_mult_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1470
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1471
lemma HInfinite_HFinite_add_cancel:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1472
     "[| x + y \<in> HInfinite; y \<in> HFinite |] ==> x \<in> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1473
apply (rule ccontr)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1474
apply (drule HFinite_HInfinite_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1475
apply (auto dest: HFinite_add simp add: HInfinite_HFinite_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1476
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1477
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1478
lemma HInfinite_HFinite_add:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1479
     "[| x \<in> HInfinite; y \<in> HFinite |] ==> x + y \<in> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1480
apply (rule_tac y = "-y" in HInfinite_HFinite_add_cancel)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1481
apply (auto simp add: add_assoc HFinite_minus_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1482
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1483
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1484
lemma HInfinite_ge_HInfinite:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1485
     "[| (x::hypreal) \<in> HInfinite; x \<le> y; 0 \<le> x |] ==> y \<in> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1486
by (auto intro: HFinite_bounded simp add: HInfinite_HFinite_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1487
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1488
lemma Infinitesimal_inverse_HInfinite:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1489
  fixes x :: "'a::real_normed_div_algebra star"
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1490
  shows "[| x \<in> Infinitesimal; x \<noteq> 0 |] ==> inverse x \<in> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1491
apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1492
apply (auto dest: Infinitesimal_HFinite_mult2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1493
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1494
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1495
lemma HInfinite_HFinite_not_Infinitesimal_mult:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1496
  fixes x y :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1497
  shows "[| x \<in> HInfinite; y \<in> HFinite - Infinitesimal |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1498
      ==> x * y \<in> HInfinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1499
apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1500
apply (frule HFinite_Infinitesimal_not_zero)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1501
apply (drule HFinite_not_Infinitesimal_inverse)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1502
apply (safe, drule HFinite_mult)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1503
apply (auto simp add: mult_assoc HFinite_HInfinite_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1504
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1505
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1506
lemma HInfinite_HFinite_not_Infinitesimal_mult2:
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1507
  fixes x y :: "'a::real_normed_div_algebra star"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1508
  shows "[| x \<in> HInfinite; y \<in> HFinite - Infinitesimal |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1509
      ==> y * x \<in> HInfinite"
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1510
apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2])
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1511
apply (frule HFinite_Infinitesimal_not_zero)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1512
apply (drule HFinite_not_Infinitesimal_inverse)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1513
apply (safe, drule_tac x="inverse y" in HFinite_mult)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1514
apply assumption
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1515
apply (auto simp add: mult_assoc [symmetric] HFinite_HInfinite_iff)
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1516
done
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1517
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1518
lemma HInfinite_gt_SReal:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1519
  "[| (x::hypreal) \<in> HInfinite; 0 < x; y \<in> Reals |] ==> y < x"
15003
6145dd7538d7 replaced monomorphic abs definitions by abs_if
paulson
parents: 14653
diff changeset
  1520
by (auto dest!: bspec simp add: HInfinite_def abs_if order_less_imp_le)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1521
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1522
lemma HInfinite_gt_zero_gt_one:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1523
  "[| (x::hypreal) \<in> HInfinite; 0 < x |] ==> 1 < x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1524
by (auto intro: HInfinite_gt_SReal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1525
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1526
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1527
lemma not_HInfinite_one [simp]: "1 \<notin> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1528
apply (simp (no_asm) add: HInfinite_HFinite_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1529
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1530
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1531
lemma approx_hrabs_disj: "abs (x::hypreal) @= x | abs x @= -x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1532
by (cut_tac x = x in hrabs_disj, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1533
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1534
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1535
subsection{*Theorems about Monads*}
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1536
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1537
lemma monad_hrabs_Un_subset: "monad (abs x) \<le> monad(x::hypreal) Un monad(-x)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1538
by (rule_tac x1 = x in hrabs_disj [THEN disjE], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1539
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1540
lemma Infinitesimal_monad_eq: "e \<in> Infinitesimal ==> monad (x+e) = monad x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1541
by (fast intro!: Infinitesimal_add_approx_self [THEN approx_sym] approx_monad_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1542
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1543
lemma mem_monad_iff: "(u \<in> monad x) = (-u \<in> monad (-x))"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1544
by (simp add: monad_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1545
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1546
lemma Infinitesimal_monad_zero_iff: "(x \<in> Infinitesimal) = (x \<in> monad 0)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1547
by (auto intro: approx_sym simp add: monad_def mem_infmal_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1548
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1549
lemma monad_zero_minus_iff: "(x \<in> monad 0) = (-x \<in> monad 0)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1550
apply (simp (no_asm) add: Infinitesimal_monad_zero_iff [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1551
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1552
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1553
lemma monad_zero_hrabs_iff: "((x::hypreal) \<in> monad 0) = (abs x \<in> monad 0)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1554
apply (rule_tac x1 = x in hrabs_disj [THEN disjE])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1555
apply (auto simp add: monad_zero_minus_iff [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1556
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1557
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1558
lemma mem_monad_self [simp]: "x \<in> monad x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1559
by (simp add: monad_def)
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1560
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1561
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1562
subsection{*Proof that @{term "x @= y"} implies @{term"\<bar>x\<bar> @= \<bar>y\<bar>"}*}
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1563
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1564
lemma approx_subset_monad: "x @= y ==> {x,y} \<le> monad x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1565
apply (simp (no_asm))
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1566
apply (simp add: approx_monad_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1567
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1568
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1569
lemma approx_subset_monad2: "x @= y ==> {x,y} \<le> monad y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1570
apply (drule approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1571
apply (fast dest: approx_subset_monad)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1572
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1573
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1574
lemma mem_monad_approx: "u \<in> monad x ==> x @= u"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1575
by (simp add: monad_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1576
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1577
lemma approx_mem_monad: "x @= u ==> u \<in> monad x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1578
by (simp add: monad_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1579
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1580
lemma approx_mem_monad2: "x @= u ==> x \<in> monad u"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1581
apply (simp add: monad_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1582
apply (blast intro!: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1583
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1584
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1585
lemma approx_mem_monad_zero: "[| x @= y;x \<in> monad 0 |] ==> y \<in> monad 0"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1586
apply (drule mem_monad_approx)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1587
apply (fast intro: approx_mem_monad approx_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1588
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1589
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1590
lemma Infinitesimal_approx_hrabs:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1591
     "[| x @= y; (x::hypreal) \<in> Infinitesimal |] ==> abs x @= abs y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1592
apply (drule Infinitesimal_monad_zero_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1593
apply (blast intro: approx_mem_monad_zero monad_zero_hrabs_iff [THEN iffD1] mem_monad_approx approx_trans3)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1594
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1595
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1596
lemma less_Infinitesimal_less:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1597
     "[| 0 < x;  (x::hypreal) \<notin>Infinitesimal;  e :Infinitesimal |] ==> e < x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1598
apply (rule ccontr)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1599
apply (auto intro: Infinitesimal_zero [THEN [2] Infinitesimal_interval] 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1600
            dest!: order_le_imp_less_or_eq simp add: linorder_not_less)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1601
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1602
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1603
lemma Ball_mem_monad_gt_zero:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1604
     "[| 0 < (x::hypreal);  x \<notin> Infinitesimal; u \<in> monad x |] ==> 0 < u"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1605
apply (drule mem_monad_approx [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1606
apply (erule bex_Infinitesimal_iff2 [THEN iffD2, THEN bexE])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1607
apply (drule_tac e = "-xa" in less_Infinitesimal_less, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1608
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1609
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1610
lemma Ball_mem_monad_less_zero:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1611
     "[| (x::hypreal) < 0; x \<notin> Infinitesimal; u \<in> monad x |] ==> u < 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1612
apply (drule mem_monad_approx [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1613
apply (erule bex_Infinitesimal_iff [THEN iffD2, THEN bexE])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1614
apply (cut_tac x = "-x" and e = xa in less_Infinitesimal_less, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1615
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1616
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1617
lemma lemma_approx_gt_zero:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1618
     "[|0 < (x::hypreal); x \<notin> Infinitesimal; x @= y|] ==> 0 < y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1619
by (blast dest: Ball_mem_monad_gt_zero approx_subset_monad)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1620
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1621
lemma lemma_approx_less_zero:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1622
     "[|(x::hypreal) < 0; x \<notin> Infinitesimal; x @= y|] ==> y < 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1623
by (blast dest: Ball_mem_monad_less_zero approx_subset_monad)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1624
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1625
theorem approx_hrabs: "(x::hypreal) @= y ==> abs x @= abs y"
20652
6e9b7617c89a added approx_hnorm theorem; removed division_by_zero class requirements from several lemmas
huffman
parents: 20633
diff changeset
  1626
by (drule approx_hnorm, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1627
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1628
lemma approx_hrabs_zero_cancel: "abs(x::hypreal) @= 0 ==> x @= 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1629
apply (cut_tac x = x in hrabs_disj)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1630
apply (auto dest: approx_minus)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1631
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1632
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1633
lemma approx_hrabs_add_Infinitesimal:
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1634
  "(e::hypreal) \<in> Infinitesimal ==> abs x @= abs(x+e)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1635
by (fast intro: approx_hrabs Infinitesimal_add_approx_self)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1636
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1637
lemma approx_hrabs_add_minus_Infinitesimal:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1638
     "(e::hypreal) \<in> Infinitesimal ==> abs x @= abs(x + -e)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1639
by (fast intro: approx_hrabs Infinitesimal_add_minus_approx_self)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1640
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1641
lemma hrabs_add_Infinitesimal_cancel:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1642
     "[| (e::hypreal) \<in> Infinitesimal; e' \<in> Infinitesimal;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1643
         abs(x+e) = abs(y+e')|] ==> abs x @= abs y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1644
apply (drule_tac x = x in approx_hrabs_add_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1645
apply (drule_tac x = y in approx_hrabs_add_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1646
apply (auto intro: approx_trans2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1647
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1648
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1649
lemma hrabs_add_minus_Infinitesimal_cancel:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1650
     "[| (e::hypreal) \<in> Infinitesimal; e' \<in> Infinitesimal;
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1651
         abs(x + -e) = abs(y + -e')|] ==> abs x @= abs y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1652
apply (drule_tac x = x in approx_hrabs_add_minus_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1653
apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1654
apply (auto intro: approx_trans2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1655
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1656
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1657
subsection {* More @{term HFinite} and @{term Infinitesimal} Theorems *}
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1658
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1659
(* interesting slightly counterintuitive theorem: necessary
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1660
   for proving that an open interval is an NS open set
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1661
*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1662
lemma Infinitesimal_add_hypreal_of_real_less:
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1663
     "[| x < y;  u \<in> Infinitesimal |]
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1664
      ==> hypreal_of_real x + u < hypreal_of_real y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1665
apply (simp add: Infinitesimal_def)
17431
70311ad8bf11 fix names in hypreal_arith.ML
huffman
parents: 17429
diff changeset
  1666
apply (drule_tac x = "hypreal_of_real y + -hypreal_of_real x" in bspec, simp)
20254
58b71535ed00 lin_arith_prover splits certain operators (e.g. min, max, abs)
webertj
parents: 20217
diff changeset
  1667
apply (simp add: abs_less_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1668
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1669
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
  1670
lemma Infinitesimal_add_hrabs_hypreal_of_real_less:
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
  1671
     "[| x \<in> Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1672
      ==> abs (hypreal_of_real r + x) < hypreal_of_real y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1673
apply (drule_tac x = "hypreal_of_real r" in approx_hrabs_add_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1674
apply (drule approx_sym [THEN bex_Infinitesimal_iff2 [THEN iffD2]])
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1675
apply (auto intro!: Infinitesimal_add_hypreal_of_real_less
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1676
            simp del: star_of_abs
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1677
            simp add: star_of_abs [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1678
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1679
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1680
lemma Infinitesimal_add_hrabs_hypreal_of_real_less2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1681
     "[| x \<in> Infinitesimal;  abs(hypreal_of_real r) < hypreal_of_real y |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1682
      ==> abs (x + hypreal_of_real r) < hypreal_of_real y"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1683
apply (rule add_commute [THEN subst])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1684
apply (erule Infinitesimal_add_hrabs_hypreal_of_real_less, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1685
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1686
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1687
lemma hypreal_of_real_le_add_Infininitesimal_cancel:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1688
     "[| u \<in> Infinitesimal; v \<in> Infinitesimal;
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1689
         hypreal_of_real x + u \<le> hypreal_of_real y + v |]
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1690
      ==> hypreal_of_real x \<le> hypreal_of_real y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1691
apply (simp add: linorder_not_less [symmetric], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1692
apply (drule_tac u = "v-u" in Infinitesimal_add_hypreal_of_real_less)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1693
apply (auto simp add: Infinitesimal_diff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1694
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1695
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1696
lemma hypreal_of_real_le_add_Infininitesimal_cancel2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1697
     "[| u \<in> Infinitesimal; v \<in> Infinitesimal;
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1698
         hypreal_of_real x + u \<le> hypreal_of_real y + v |]
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1699
      ==> x \<le> y"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1700
by (blast intro: star_of_le [THEN iffD1] 
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1701
          intro!: hypreal_of_real_le_add_Infininitesimal_cancel)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1702
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1703
lemma hypreal_of_real_less_Infinitesimal_le_zero:
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1704
    "[| hypreal_of_real x < e; e \<in> Infinitesimal |] ==> hypreal_of_real x \<le> 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1705
apply (rule linorder_not_less [THEN iffD1], safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1706
apply (drule Infinitesimal_interval)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1707
apply (drule_tac [4] SReal_hypreal_of_real [THEN SReal_Infinitesimal_zero], auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1708
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1709
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1710
(*used once, in Lim/NSDERIV_inverse*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1711
lemma Infinitesimal_add_not_zero:
21783
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
  1712
     "[| h \<in> Infinitesimal; x \<noteq> 0 |] ==> star_of x + h \<noteq> 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1713
apply auto
21783
d75108a9665a generalize some theorems
huffman
parents: 21404
diff changeset
  1714
apply (subgoal_tac "h = - star_of x", auto intro: equals_zero_I [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1715
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1716
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1717
lemma Infinitesimal_square_cancel [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1718
     "(x::hypreal)*x + y*y \<in> Infinitesimal ==> x*x \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1719
apply (rule Infinitesimal_interval2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1720
apply (rule_tac [3] zero_le_square, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1721
apply (auto simp add: zero_le_square)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1722
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1723
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1724
lemma HFinite_square_cancel [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1725
  "(x::hypreal)*x + y*y \<in> HFinite ==> x*x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1726
apply (rule HFinite_bounded, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1727
apply (auto simp add: zero_le_square)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1728
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1729
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1730
lemma Infinitesimal_square_cancel2 [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1731
     "(x::hypreal)*x + y*y \<in> Infinitesimal ==> y*y \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1732
apply (rule Infinitesimal_square_cancel)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1733
apply (rule add_commute [THEN subst])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1734
apply (simp (no_asm))
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1735
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1736
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1737
lemma HFinite_square_cancel2 [simp]:
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1738
  "(x::hypreal)*x + y*y \<in> HFinite ==> y*y \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1739
apply (rule HFinite_square_cancel)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1740
apply (rule add_commute [THEN subst])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1741
apply (simp (no_asm))
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1742
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1743
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1744
lemma Infinitesimal_sum_square_cancel [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1745
     "(x::hypreal)*x + y*y + z*z \<in> Infinitesimal ==> x*x \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1746
apply (rule Infinitesimal_interval2, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1747
apply (rule_tac [2] zero_le_square, simp)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1748
apply (insert zero_le_square [of y]) 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1749
apply (insert zero_le_square [of z], simp)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1750
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1751
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1752
lemma HFinite_sum_square_cancel [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1753
     "(x::hypreal)*x + y*y + z*z \<in> HFinite ==> x*x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1754
apply (rule HFinite_bounded, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1755
apply (rule_tac [2] zero_le_square)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1756
apply (insert zero_le_square [of y]) 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1757
apply (insert zero_le_square [of z], simp)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1758
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1759
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1760
lemma Infinitesimal_sum_square_cancel2 [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1761
     "(y::hypreal)*y + x*x + z*z \<in> Infinitesimal ==> x*x \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1762
apply (rule Infinitesimal_sum_square_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1763
apply (simp add: add_ac)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1764
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1765
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1766
lemma HFinite_sum_square_cancel2 [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1767
     "(y::hypreal)*y + x*x + z*z \<in> HFinite ==> x*x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1768
apply (rule HFinite_sum_square_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1769
apply (simp add: add_ac)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1770
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1771
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1772
lemma Infinitesimal_sum_square_cancel3 [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1773
     "(z::hypreal)*z + y*y + x*x \<in> Infinitesimal ==> x*x \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1774
apply (rule Infinitesimal_sum_square_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1775
apply (simp add: add_ac)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1776
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1777
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1778
lemma HFinite_sum_square_cancel3 [simp]:
20541
f614c619b1e1 generalized types of Infinitesimal, HFinite, and HInfinite to work over nonstandard extensions of any real normed vector space
huffman
parents: 20485
diff changeset
  1779
     "(z::hypreal)*z + y*y + x*x \<in> HFinite ==> x*x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1780
apply (rule HFinite_sum_square_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1781
apply (simp add: add_ac)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1782
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1783
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1784
lemma monad_hrabs_less:
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1785
     "[| y \<in> monad x; 0 < hypreal_of_real e |]
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  1786
      ==> abs (y - x) < hypreal_of_real e"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1787
apply (drule mem_monad_approx [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1788
apply (drule bex_Infinitesimal_iff [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1789
apply (auto dest!: InfinitesimalD)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1790
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1791
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1792
lemma mem_monad_SReal_HFinite:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1793
     "x \<in> monad (hypreal_of_real  a) ==> x \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1794
apply (drule mem_monad_approx [THEN approx_sym])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1795
apply (drule bex_Infinitesimal_iff2 [THEN iffD2])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1796
apply (safe dest!: Infinitesimal_subset_HFinite [THEN subsetD])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1797
apply (erule SReal_hypreal_of_real [THEN SReal_subset_HFinite [THEN subsetD], THEN HFinite_add])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1798
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1799
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1800
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1801
subsection{* Theorems about Standard Part*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1802
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1803
lemma st_approx_self: "x \<in> HFinite ==> st x @= x"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1804
apply (simp add: st_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1805
apply (frule st_part_Ex, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1806
apply (rule someI2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1807
apply (auto intro: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1808
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1809
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1810
lemma st_SReal: "x \<in> HFinite ==> st x \<in> Reals"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1811
apply (simp add: st_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1812
apply (frule st_part_Ex, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1813
apply (rule someI2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1814
apply (auto intro: approx_sym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1815
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1816
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1817
lemma st_HFinite: "x \<in> HFinite ==> st x \<in> HFinite"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1818
by (erule st_SReal [THEN SReal_subset_HFinite [THEN subsetD]])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1819
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1820
lemma st_unique: "\<lbrakk>r \<in> \<real>; r \<approx> x\<rbrakk> \<Longrightarrow> st x = r"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1821
apply (frule SReal_subset_HFinite [THEN subsetD])
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1822
apply (drule (1) approx_HFinite)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1823
apply (unfold st_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1824
apply (rule some_equality)
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1825
apply (auto intro: approx_unique_real)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1826
done
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1827
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1828
lemma st_SReal_eq: "x \<in> Reals ==> st x = x"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1829
apply (erule st_unique)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1830
apply (rule approx_refl)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1831
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1832
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1833
lemma st_hypreal_of_real [simp]: "st (hypreal_of_real x) = hypreal_of_real x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1834
by (rule SReal_hypreal_of_real [THEN st_SReal_eq])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1835
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1836
lemma st_eq_approx: "[| x \<in> HFinite; y \<in> HFinite; st x = st y |] ==> x @= y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1837
by (auto dest!: st_approx_self elim!: approx_trans3)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1838
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1839
lemma approx_st_eq: 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1840
  assumes "x \<in> HFinite" and "y \<in> HFinite" and "x @= y" 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1841
  shows "st x = st y"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1842
proof -
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1843
  have "st x @= x" "st y @= y" "st x \<in> Reals" "st y \<in> Reals"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1844
    by (simp_all add: st_approx_self st_SReal prems) 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1845
  with prems show ?thesis 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1846
    by (fast elim: approx_trans approx_trans2 SReal_approx_iff [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1847
qed
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1848
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1849
lemma st_eq_approx_iff:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1850
     "[| x \<in> HFinite; y \<in> HFinite|]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1851
                   ==> (x @= y) = (st x = st y)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1852
by (blast intro: approx_st_eq st_eq_approx)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1853
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1854
lemma st_Infinitesimal_add_SReal:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1855
     "[| x \<in> Reals; e \<in> Infinitesimal |] ==> st(x + e) = x"
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1856
apply (erule st_unique)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1857
apply (erule Infinitesimal_add_approx_self)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1858
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1859
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1860
lemma st_Infinitesimal_add_SReal2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1861
     "[| x \<in> Reals; e \<in> Infinitesimal |] ==> st(e + x) = x"
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1862
apply (erule st_unique)
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1863
apply (erule Infinitesimal_add_approx_self2)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1864
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1865
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1866
lemma HFinite_st_Infinitesimal_add:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1867
     "x \<in> HFinite ==> \<exists>e \<in> Infinitesimal. x = st(x) + e"
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1868
by (blast dest!: st_approx_self [THEN approx_sym] bex_Infinitesimal_iff2 [THEN iffD2])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1869
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1870
lemma st_add: "\<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> st (x + y) = st x + st y"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1871
by (simp add: st_unique st_SReal st_approx_self approx_add)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1872
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1873
lemma st_number_of [simp]: "st (number_of w) = number_of w"
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  1874
by (rule Reals_number_of [THEN st_SReal_eq])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1875
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1876
(*the theorem above for the special cases of zero and one*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1877
lemma [simp]: "st 0 = 0" "st 1 = 1"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1878
by (simp_all add: st_SReal_eq)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1879
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1880
lemma st_minus: "x \<in> HFinite \<Longrightarrow> st (- x) = - st x"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1881
by (simp add: st_unique st_SReal st_approx_self approx_minus)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1882
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1883
lemma st_diff: "\<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> st (x - y) = st x - st y"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1884
by (simp add: st_unique st_SReal st_approx_self approx_diff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1885
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1886
lemma st_mult: "\<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> st (x * y) = st x * st y"
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1887
by (simp add: st_unique st_SReal st_approx_self approx_mult_HFinite)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1888
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1889
lemma st_Infinitesimal: "x \<in> Infinitesimal ==> st x = 0"
20723
3758db26a3fd add lemmas approx_diff and st_unique, shorten st proofs
huffman
parents: 20721
diff changeset
  1890
by (simp add: st_unique mem_infmal_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1891
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1892
lemma st_not_Infinitesimal: "st(x) \<noteq> 0 ==> x \<notin> Infinitesimal"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1893
by (fast intro: st_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1894
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1895
lemma st_inverse:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1896
     "[| x \<in> HFinite; st x \<noteq> 0 |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1897
      ==> st(inverse x) = inverse (st x)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1898
apply (rule_tac c1 = "st x" in hypreal_mult_left_cancel [THEN iffD1])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1899
apply (auto simp add: st_mult [symmetric] st_not_Infinitesimal HFinite_inverse)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1900
apply (subst right_inverse, auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1901
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1902
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1903
lemma st_divide [simp]:
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1904
     "[| x \<in> HFinite; y \<in> HFinite; st y \<noteq> 0 |]
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1905
      ==> st(x/y) = (st x) / (st y)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1906
by (simp add: divide_inverse st_mult st_not_Infinitesimal HFinite_inverse st_inverse)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1907
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  1908
lemma st_idempotent [simp]: "x \<in> HFinite ==> st(st(x)) = st(x)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1909
by (blast intro: st_HFinite st_approx_self approx_st_eq)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1910
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1911
lemma Infinitesimal_add_st_less:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1912
     "[| x \<in> HFinite; y \<in> HFinite; u \<in> Infinitesimal; st x < st y |] 
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1913
      ==> st x + u < st y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1914
apply (drule st_SReal)+
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1915
apply (auto intro!: Infinitesimal_add_hypreal_of_real_less simp add: SReal_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1916
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1917
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1918
lemma Infinitesimal_add_st_le_cancel:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1919
     "[| x \<in> HFinite; y \<in> HFinite;
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1920
         u \<in> Infinitesimal; st x \<le> st y + u
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1921
      |] ==> st x \<le> st y"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1922
apply (simp add: linorder_not_less [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1923
apply (auto dest: Infinitesimal_add_st_less)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1924
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1925
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1926
lemma st_le: "[| x \<in> HFinite; y \<in> HFinite; x \<le> y |] ==> st(x) \<le> st(y)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1927
apply (frule HFinite_st_Infinitesimal_add)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1928
apply (rotate_tac 1)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1929
apply (frule HFinite_st_Infinitesimal_add, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1930
apply (rule Infinitesimal_add_st_le_cancel)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1931
apply (rule_tac [3] x = ea and y = e in Infinitesimal_diff)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1932
apply (auto simp add: add_assoc [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1933
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1934
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1935
lemma st_zero_le: "[| 0 \<le> x;  x \<in> HFinite |] ==> 0 \<le> st x"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
  1936
apply (subst numeral_0_eq_0 [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1937
apply (rule st_number_of [THEN subst])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1938
apply (rule st_le, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1939
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1940
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1941
lemma st_zero_ge: "[| x \<le> 0;  x \<in> HFinite |] ==> st x \<le> 0"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
  1942
apply (subst numeral_0_eq_0 [symmetric])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1943
apply (rule st_number_of [THEN subst])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1944
apply (rule st_le, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1945
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1946
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1947
lemma st_hrabs: "x \<in> HFinite ==> abs(st x) = st(abs x)"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1948
apply (simp add: linorder_not_le st_zero_le abs_if st_minus
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1949
   linorder_not_less)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1950
apply (auto dest!: st_zero_ge [OF order_less_imp_le]) 
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1951
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1952
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1953
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1954
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1955
subsection {* Alternative Definitions using Free Ultrafilter *}
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1956
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1957
subsubsection {* @{term HFinite} *}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1958
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1959
lemma HFinite_FreeUltrafilterNat:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1960
    "star_n X \<in> HFinite 
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1961
     ==> \<exists>u. {n. norm (X n) < u} \<in> FreeUltrafilterNat"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1962
apply (auto simp add: HFinite_def SReal_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1963
apply (rule_tac x=r in exI)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1964
apply (simp add: hnorm_def star_of_def starfun_star_n)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1965
apply (simp add: star_less_def starP2_star_n)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1966
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1967
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1968
lemma FreeUltrafilterNat_HFinite:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1969
     "\<exists>u. {n. norm (X n) < u} \<in> FreeUltrafilterNat
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1970
       ==>  star_n X \<in> HFinite"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1971
apply (auto simp add: HFinite_def mem_Rep_star_iff)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1972
apply (rule_tac x="star_of u" in bexI)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1973
apply (simp add: hnorm_def starfun_star_n star_of_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1974
apply (simp add: star_less_def starP2_star_n)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1975
apply (simp add: SReal_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1976
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1977
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1978
lemma HFinite_FreeUltrafilterNat_iff:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1979
     "(star_n X \<in> HFinite) = (\<exists>u. {n. norm (X n) < u} \<in> FreeUltrafilterNat)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1980
by (blast intro!: HFinite_FreeUltrafilterNat FreeUltrafilterNat_HFinite)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1981
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  1982
subsubsection {* @{term HInfinite} *}
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1983
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1984
lemma lemma_Compl_eq: "- {n. u < norm (xa n)} = {n. norm (xa n) \<le> u}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1985
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1986
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1987
lemma lemma_Compl_eq2: "- {n. norm (xa n) < u} = {n. u \<le> norm (xa n)}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1988
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1989
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1990
lemma lemma_Int_eq1:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1991
     "{n. norm (xa n) \<le> u} Int {n. u \<le> norm (xa n)}
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1992
          = {n. norm(xa n) = u}"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  1993
by auto
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1994
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  1995
lemma lemma_FreeUltrafilterNat_one:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  1996
     "{n. norm (xa n) = u} \<le> {n. norm (xa n) < u + (1::real)}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1997
by auto
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1998
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  1999
(*-------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2000
  Exclude this type of sets from free
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2001
  ultrafilter for Infinite numbers!
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2002
 -------------------------------------*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2003
lemma FreeUltrafilterNat_const_Finite:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2004
     "{n. norm (X n) = u} \<in> FreeUltrafilterNat ==> star_n X \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2005
apply (rule FreeUltrafilterNat_HFinite)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2006
apply (rule_tac x = "u + 1" in exI)
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2007
apply (erule ultra, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2008
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2009
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2010
lemma HInfinite_FreeUltrafilterNat:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2011
     "star_n X \<in> HInfinite ==> \<forall>u. {n. u < norm (X n)} \<in> FreeUltrafilterNat"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2012
apply (drule HInfinite_HFinite_iff [THEN iffD1])
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2013
apply (simp add: HFinite_FreeUltrafilterNat_iff)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2014
apply (rule allI, drule_tac x="u + 1" in spec)
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2015
apply (drule FreeUltrafilterNat.not_memD)
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2016
apply (simp add: Collect_neg_eq [symmetric] linorder_not_less)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2017
apply (erule ultra, simp)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2018
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2019
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2020
lemma lemma_Int_HI:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2021
     "{n. norm (Xa n) < u} Int {n. X n = Xa n} \<subseteq> {n. norm (X n) < (u::real)}"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2022
by auto
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2023
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2024
lemma lemma_Int_HIa: "{n. u < norm (X n)} Int {n. norm (X n) < u} = {}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2025
by (auto intro: order_less_asym)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2026
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2027
lemma FreeUltrafilterNat_HInfinite:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2028
     "\<forall>u. {n. u < norm (X n)} \<in> FreeUltrafilterNat ==> star_n X \<in> HInfinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2029
apply (rule HInfinite_HFinite_iff [THEN iffD2])
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2030
apply (safe, drule HFinite_FreeUltrafilterNat, safe)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2031
apply (drule_tac x = u in spec)
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2032
apply (drule (1) FreeUltrafilterNat.Int)
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2033
apply (simp add: Collect_conj_eq [symmetric])
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2034
apply (subgoal_tac "\<forall>n. \<not> (norm (X n) < u \<and> u < norm (X n))", auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2035
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2036
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2037
lemma HInfinite_FreeUltrafilterNat_iff:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2038
     "(star_n X \<in> HInfinite) = (\<forall>u. {n. u < norm (X n)} \<in> FreeUltrafilterNat)"
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2039
by (blast intro!: HInfinite_FreeUltrafilterNat FreeUltrafilterNat_HInfinite)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2040
20721
54dd8f96235b reorganize section headings
huffman
parents: 20713
diff changeset
  2041
subsubsection {* @{term Infinitesimal} *}
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
  2042
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2043
lemma ball_SReal_eq: "(\<forall>x::hypreal \<in> Reals. P x) = (\<forall>x::real. P (star_of x))"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2044
by (unfold SReal_def, auto)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2045
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2046
lemma Infinitesimal_FreeUltrafilterNat:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2047
     "star_n X \<in> Infinitesimal ==> \<forall>u>0. {n. norm (X n) < u} \<in> \<U>"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2048
apply (simp add: Infinitesimal_def ball_SReal_eq)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2049
apply (simp add: hnorm_def starfun_star_n star_of_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2050
apply (simp add: star_less_def starP2_star_n)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2051
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2052
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2053
lemma FreeUltrafilterNat_Infinitesimal:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2054
     "\<forall>u>0. {n. norm (X n) < u} \<in> \<U> ==> star_n X \<in> Infinitesimal"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2055
apply (simp add: Infinitesimal_def ball_SReal_eq)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2056
apply (simp add: hnorm_def starfun_star_n star_of_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2057
apply (simp add: star_less_def starP2_star_n)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2058
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2059
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2060
lemma Infinitesimal_FreeUltrafilterNat_iff:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2061
     "(star_n X \<in> Infinitesimal) = (\<forall>u>0. {n. norm (X n) < u} \<in> \<U>)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  2062
by (blast intro!: Infinitesimal_FreeUltrafilterNat FreeUltrafilterNat_Infinitesimal)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2063
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2064
(*------------------------------------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2065
         Infinitesimals as smaller than 1/n for all n::nat (> 0)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2066
 ------------------------------------------------------------------------*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2067
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2068
lemma lemma_Infinitesimal:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2069
     "(\<forall>r. 0 < r --> x < r) = (\<forall>n. x < inverse(real (Suc n)))"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2070
apply (auto simp add: real_of_nat_Suc_gt_zero)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2071
apply (blast dest!: reals_Archimedean intro: order_less_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2072
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2073
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2074
lemma lemma_Infinitesimal2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2075
     "(\<forall>r \<in> Reals. 0 < r --> x < r) =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2076
      (\<forall>n. x < inverse(hypreal_of_nat (Suc n)))"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2077
apply safe
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2078
apply (drule_tac x = "inverse (hypreal_of_real (real (Suc n))) " in bspec)
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21783
diff changeset
  2079
apply (simp (no_asm_use))
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  2080
apply (rule real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive, THEN star_of_less [THEN iffD2], THEN [2] impE])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2081
prefer 2 apply assumption
20730
da903f59e9ba hypreal_of_nat abbreviates of_nat
huffman
parents: 20729
diff changeset
  2082
apply (simp add: real_of_nat_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2083
apply (auto dest!: reals_Archimedean simp add: SReal_iff)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17298
diff changeset
  2084
apply (drule star_of_less [THEN iffD2])
20730
da903f59e9ba hypreal_of_nat abbreviates of_nat
huffman
parents: 20729
diff changeset
  2085
apply (simp add: real_of_nat_def)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2086
apply (blast intro: order_less_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2087
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2088
14378
69c4d5997669 generic of_nat and of_int functions, and generalization of iszero
paulson
parents: 14371
diff changeset
  2089
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2090
lemma Infinitesimal_hypreal_of_nat_iff:
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2091
     "Infinitesimal = {x. \<forall>n. hnorm x < inverse (hypreal_of_nat (Suc n))}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2092
apply (simp add: Infinitesimal_def)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2093
apply (auto simp add: lemma_Infinitesimal2)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2094
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2095
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2096
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2097
subsection{*Proof that @{term omega} is an infinite number*}
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2098
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2099
text{*It will follow that epsilon is an infinitesimal number.*}
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2100
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2101
lemma Suc_Un_eq: "{n. n < Suc m} = {n. n < m} Un {n. n = m}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2102
by (auto simp add: less_Suc_eq)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2103
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2104
(*-------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2105
  Prove that any segment is finite and
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2106
  hence cannot belong to FreeUltrafilterNat
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2107
 -------------------------------------------*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2108
lemma finite_nat_segment: "finite {n::nat. n < m}"
15251
bb6f072c8d10 converted some induct_tac to induct
paulson
parents: 15234
diff changeset
  2109
apply (induct "m")
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2110
apply (auto simp add: Suc_Un_eq)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2111
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2112
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2113
lemma finite_real_of_nat_segment: "finite {n::nat. real n < real (m::nat)}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2114
by (auto intro: finite_nat_segment)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2115
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2116
lemma finite_real_of_nat_less_real: "finite {n::nat. real n < u}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2117
apply (cut_tac x = u in reals_Archimedean2, safe)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2118
apply (rule finite_real_of_nat_segment [THEN [2] finite_subset])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2119
apply (auto dest: order_less_trans)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2120
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2121
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2122
lemma lemma_real_le_Un_eq:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2123
     "{n. f n \<le> u} = {n. f n < u} Un {n. u = (f n :: real)}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2124
by (auto dest: order_le_imp_less_or_eq simp add: order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2125
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2126
lemma finite_real_of_nat_le_real: "finite {n::nat. real n \<le> u}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2127
by (auto simp add: lemma_real_le_Un_eq lemma_finite_omega_set finite_real_of_nat_less_real)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2128
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2129
lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. abs(real n) \<le> u}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2130
apply (simp (no_asm) add: real_of_nat_Suc_gt_zero finite_real_of_nat_le_real)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2131
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2132
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2133
lemma rabs_real_of_nat_le_real_FreeUltrafilterNat:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2134
     "{n. abs(real n) \<le> u} \<notin> FreeUltrafilterNat"
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2135
by (blast intro!: FreeUltrafilterNat.finite finite_rabs_real_of_nat_le_real)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2136
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2137
lemma FreeUltrafilterNat_nat_gt_real: "{n. u < real n} \<in> FreeUltrafilterNat"
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2138
apply (rule ccontr, drule FreeUltrafilterNat.not_memD)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2139
apply (subgoal_tac "- {n::nat. u < real n} = {n. real n \<le> u}")
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2140
prefer 2 apply force
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2141
apply (simp add: finite_real_of_nat_le_real [THEN FreeUltrafilterNat.finite])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2142
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2143
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2144
(*--------------------------------------------------------------
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2145
 The complement of {n. abs(real n) \<le> u} =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2146
 {n. u < abs (real n)} is in FreeUltrafilterNat
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2147
 by property of (free) ultrafilters
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2148
 --------------------------------------------------------------*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2149
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2150
lemma Compl_real_le_eq: "- {n::nat. real n \<le> u} = {n. u < real n}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2151
by (auto dest!: order_le_less_trans simp add: linorder_not_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2152
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2153
text{*@{term omega} is a member of @{term HInfinite}*}
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2154
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2155
lemma FreeUltrafilterNat_omega: "{n. u < real n} \<in> FreeUltrafilterNat"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2156
apply (cut_tac u = u in rabs_real_of_nat_le_real_FreeUltrafilterNat)
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2157
apply (auto dest: FreeUltrafilterNat.not_memD simp add: Compl_real_le_eq)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2158
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2159
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2160
theorem HInfinite_omega [simp]: "omega \<in> HInfinite"
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2161
apply (simp add: omega_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2162
apply (rule FreeUltrafilterNat_HInfinite)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2163
apply (simp (no_asm) add: real_norm_def real_of_nat_Suc diff_less_eq [symmetric] FreeUltrafilterNat_omega)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2164
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2165
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2166
(*-----------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2167
       Epsilon is a member of Infinitesimal
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2168
 -----------------------------------------------*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2169
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2170
lemma Infinitesimal_epsilon [simp]: "epsilon \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2171
by (auto intro!: HInfinite_inverse_Infinitesimal HInfinite_omega simp add: hypreal_epsilon_inverse_omega)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2172
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2173
lemma HFinite_epsilon [simp]: "epsilon \<in> HFinite"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2174
by (auto intro: Infinitesimal_subset_HFinite [THEN subsetD])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2175
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15140
diff changeset
  2176
lemma epsilon_approx_zero [simp]: "epsilon @= 0"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2177
apply (simp (no_asm) add: mem_infmal_iff [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2178
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2179
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2180
(*------------------------------------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2181
  Needed for proof that we define a hyperreal [<X(n)] @= hypreal_of_real a given
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2182
  that \<forall>n. |X n - a| < 1/n. Used in proof of NSLIM => LIM.
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2183
 -----------------------------------------------------------------------*)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2184
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2185
lemma real_of_nat_less_inverse_iff:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2186
     "0 < u  ==> (u < inverse (real(Suc n))) = (real(Suc n) < inverse u)"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2187
apply (simp add: inverse_eq_divide)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2188
apply (subst pos_less_divide_eq, assumption)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2189
apply (subst pos_less_divide_eq)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2190
 apply (simp add: real_of_nat_Suc_gt_zero)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2191
apply (simp add: real_mult_commute)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2192
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2193
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2194
lemma finite_inverse_real_of_posnat_gt_real:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2195
     "0 < u ==> finite {n. u < inverse(real(Suc n))}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2196
apply (simp (no_asm_simp) add: real_of_nat_less_inverse_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2197
apply (simp (no_asm_simp) add: real_of_nat_Suc less_diff_eq [symmetric])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2198
apply (rule finite_real_of_nat_less_real)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2199
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2200
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2201
lemma lemma_real_le_Un_eq2:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2202
     "{n. u \<le> inverse(real(Suc n))} =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2203
     {n. u < inverse(real(Suc n))} Un {n. u = inverse(real(Suc n))}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2204
apply (auto dest: order_le_imp_less_or_eq simp add: order_less_imp_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2205
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2206
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2207
lemma real_of_nat_inverse_eq_iff:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2208
     "(u = inverse (real(Suc n))) = (real(Suc n) = inverse u)"
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15531
diff changeset
  2209
by (auto simp add: real_of_nat_Suc_gt_zero real_not_refl2 [THEN not_sym])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2210
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2211
lemma lemma_finite_omega_set2: "finite {n::nat. u = inverse(real(Suc n))}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2212
apply (simp (no_asm_simp) add: real_of_nat_inverse_eq_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2213
apply (cut_tac x = "inverse u - 1" in lemma_finite_omega_set)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2214
apply (simp add: real_of_nat_Suc diff_eq_eq [symmetric] eq_commute)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2215
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2216
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2217
lemma finite_inverse_real_of_posnat_ge_real:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2218
     "0 < u ==> finite {n. u \<le> inverse(real(Suc n))}"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2219
by (auto simp add: lemma_real_le_Un_eq2 lemma_finite_omega_set2 finite_inverse_real_of_posnat_gt_real)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2220
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2221
lemma inverse_real_of_posnat_ge_real_FreeUltrafilterNat:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2222
     "0 < u ==> {n. u \<le> inverse(real(Suc n))} \<notin> FreeUltrafilterNat"
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2223
by (blast intro!: FreeUltrafilterNat.finite finite_inverse_real_of_posnat_ge_real)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2224
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2225
(*--------------------------------------------------------------
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2226
    The complement of  {n. u \<le> inverse(real(Suc n))} =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2227
    {n. inverse(real(Suc n)) < u} is in FreeUltrafilterNat
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2228
    by property of (free) ultrafilters
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2229
 --------------------------------------------------------------*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2230
lemma Compl_le_inverse_eq:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2231
     "- {n. u \<le> inverse(real(Suc n))} =
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2232
      {n. inverse(real(Suc n)) < u}"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2233
apply (auto dest!: order_le_less_trans simp add: linorder_not_le)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2234
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2235
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2236
lemma FreeUltrafilterNat_inverse_real_of_posnat:
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2237
     "0 < u ==>
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2238
      {n. inverse(real(Suc n)) < u} \<in> FreeUltrafilterNat"
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2239
apply (cut_tac u = u in inverse_real_of_posnat_ge_real_FreeUltrafilterNat)
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2240
apply (auto dest: FreeUltrafilterNat.not_memD simp add: Compl_le_inverse_eq)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2241
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2242
21865
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2243
text{* Example of an hypersequence (i.e. an extended standard sequence)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2244
   whose term with an hypernatural suffix is an infinitesimal i.e.
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2245
   the whn'nth term of the hypersequence is a member of Infinitesimal*}
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2246
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2247
lemma SEQ_Infinitesimal:
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2248
      "( *f* (%n::nat. inverse(real(Suc n)))) whn : Infinitesimal"
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2249
apply (simp add: hypnat_omega_def starfun_star_n star_n_inverse)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2250
apply (simp add: Infinitesimal_FreeUltrafilterNat_iff)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2251
apply (simp add: real_of_nat_Suc_gt_zero FreeUltrafilterNat_inverse_real_of_posnat)
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2252
done
55cc354fd2d9 moved several theorems; rearranged theory dependencies
huffman
parents: 21855
diff changeset
  2253
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2254
text{* Example where we get a hyperreal from a real sequence
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2255
      for which a particular property holds. The theorem is
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2256
      used in proofs about equivalence of nonstandard and
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2257
      standard neighbourhoods. Also used for equivalence of
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2258
      nonstandard ans standard definitions of pointwise
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2259
      limit.*}
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2260
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2261
(*-----------------------------------------------------
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2262
    |X(n) - x| < 1/n ==> [<X n>] - hypreal_of_real x| \<in> Infinitesimal
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2263
 -----------------------------------------------------*)
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2264
lemma real_seq_to_hypreal_Infinitesimal:
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2265
     "\<forall>n. norm(X n - x) < inverse(real(Suc n))
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2266
     ==> star_n X - star_of x \<in> Infinitesimal"
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2267
apply (auto intro!: bexI dest: FreeUltrafilterNat_inverse_real_of_posnat FreeUltrafilterNat.Int intro: order_less_trans FreeUltrafilterNat.subset simp add: star_n_diff star_of_def Infinitesimal_FreeUltrafilterNat_iff star_n_inverse)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2268
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2269
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2270
lemma real_seq_to_hypreal_approx:
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2271
     "\<forall>n. norm(X n - x) < inverse(real(Suc n))
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2272
      ==> star_n X @= star_of x"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2273
apply (subst approx_minus_iff)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2274
apply (rule mem_infmal_iff [THEN subst])
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2275
apply (erule real_seq_to_hypreal_Infinitesimal)
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2276
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2277
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2278
lemma real_seq_to_hypreal_approx2:
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2279
     "\<forall>n. norm(x - X n) < inverse(real(Suc n))
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2280
               ==> star_n X @= star_of x"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2281
apply (rule real_seq_to_hypreal_approx)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2282
apply (subst norm_minus_cancel [symmetric])
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20541
diff changeset
  2283
apply (simp del: norm_minus_cancel)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2284
done
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2285
14420
4e72cd222e0b converted Hyperreal/HTranscendental to Isar script
paulson
parents: 14387
diff changeset
  2286
lemma real_seq_to_hypreal_Infinitesimal2:
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2287
     "\<forall>n. norm(X n - Y n) < inverse(real(Suc n))
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2288
      ==> star_n X - star_n Y \<in> Infinitesimal"
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2289
by (auto intro!: bexI
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2290
	 dest: FreeUltrafilterNat_inverse_real_of_posnat 
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2291
	       FreeUltrafilterNat.Int
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
  2292
	 intro: order_less_trans FreeUltrafilterNat.subset 
20563
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2293
	 simp add: Infinitesimal_FreeUltrafilterNat_iff star_n_diff 
44eda2314aab replace (x + - y) with (x - y)
huffman
parents: 20562
diff changeset
  2294
                   star_n_inverse)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 12114
diff changeset
  2295
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
  2296
end