src/HOL/Hyperreal/HyperDef.thy
author huffman
Thu, 14 Dec 2006 22:18:08 +0100
changeset 21856 f44628fb2033
parent 21855 74909ecaf20a
child 21865 55cc354fd2d9
permissions -rw-r--r--
remove commented section
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20245
54db3583354f title fixed
webertj
parents: 19931
diff changeset
     1
(*  Title       : HOL/Hyperreal/HyperDef.thy
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     2
    ID          : $Id$
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     3
    Author      : Jacques D. Fleuriot
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     4
    Copyright   : 1998  University of Cambridge
14468
6be497cacab5 heavy tidying
paulson
parents: 14430
diff changeset
     5
    Conversion to Isar and new proofs by Lawrence C Paulson, 2004
13487
wenzelm
parents: 12018
diff changeset
     6
*)
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     7
14468
6be497cacab5 heavy tidying
paulson
parents: 14430
diff changeset
     8
header{*Construction of Hyperreals Using Ultrafilters*}
6be497cacab5 heavy tidying
paulson
parents: 14430
diff changeset
     9
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15085
diff changeset
    10
theory HyperDef
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
    11
imports StarClasses "../Real/Real"
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15085
diff changeset
    12
begin
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    13
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
    14
types hypreal = "real star"
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
    15
19380
b808efaa5828 tuned syntax/abbreviations;
wenzelm
parents: 17429
diff changeset
    16
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    17
  hypreal_of_real :: "real => real star" where
19380
b808efaa5828 tuned syntax/abbreviations;
wenzelm
parents: 17429
diff changeset
    18
  "hypreal_of_real == star_of"
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    19
19765
dfe940911617 misc cleanup;
wenzelm
parents: 19380
diff changeset
    20
definition
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    21
  omega :: hypreal where
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    22
   -- {*an infinite number @{text "= [<1,2,3,...>]"} *}
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    23
  "omega = star_n (\<lambda>n. real (Suc n))"
13487
wenzelm
parents: 12018
diff changeset
    24
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    25
definition
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    26
  epsilon :: hypreal where
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    27
   -- {*an infinitesimal number @{text "= [<1,1/2,1/3,...>]"} *}
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    28
  "epsilon = star_n (\<lambda>n. inverse (real (Suc n)))"
10919
144ede948e58 renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents: 10834
diff changeset
    29
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 20765
diff changeset
    30
notation (xsymbols)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    31
  omega  ("\<omega>") and
19765
dfe940911617 misc cleanup;
wenzelm
parents: 19380
diff changeset
    32
  epsilon  ("\<epsilon>")
10919
144ede948e58 renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents: 10834
diff changeset
    33
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 20765
diff changeset
    34
notation (HTML output)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21210
diff changeset
    35
  omega  ("\<omega>") and
19765
dfe940911617 misc cleanup;
wenzelm
parents: 19380
diff changeset
    36
  epsilon  ("\<epsilon>")
14565
c6dc17aab88a use more symbols in HTML output
kleing
parents: 14477
diff changeset
    37
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
    38
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    39
subsection {* Real vector class instances *}
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    40
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    41
instance star :: (scaleR) scaleR ..
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    42
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    43
defs (overloaded)
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    44
  star_scaleR_def [transfer_unfold]: "scaleR r \<equiv> *f* (scaleR r)"
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    45
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    46
lemma Standard_scaleR [simp]: "x \<in> Standard \<Longrightarrow> scaleR r x \<in> Standard"
20726
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    47
by (simp add: star_scaleR_def)
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    48
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    49
lemma star_of_scaleR [simp]: "star_of (scaleR r x) = scaleR r (star_of x)"
20726
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    50
by transfer (rule refl)
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    51
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    52
instance star :: (real_vector) real_vector
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    53
proof
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    54
  fix a b :: real
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    55
  show "\<And>x y::'a star. scaleR a (x + y) = scaleR a x + scaleR a y"
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    56
    by transfer (rule scaleR_right_distrib)
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    57
  show "\<And>x::'a star. scaleR (a + b) x = scaleR a x + scaleR b x"
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    58
    by transfer (rule scaleR_left_distrib)
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    59
  show "\<And>x::'a star. scaleR a (scaleR b x) = scaleR (a * b) x"
20765
807c5f7dcb94 rearranged axioms and simp rules for scaleR
huffman
parents: 20753
diff changeset
    60
    by transfer (rule scaleR_scaleR)
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    61
  show "\<And>x::'a star. scaleR 1 x = x"
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    62
    by transfer (rule scaleR_one)
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    63
qed
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    64
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    65
instance star :: (real_algebra) real_algebra
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    66
proof
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    67
  fix a :: real
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    68
  show "\<And>x y::'a star. scaleR a x * y = scaleR a (x * y)"
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    69
    by transfer (rule mult_scaleR_left)
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
    70
  show "\<And>x y::'a star. x * scaleR a y = scaleR a (x * y)"
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    71
    by transfer (rule mult_scaleR_right)
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    72
qed
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    73
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    74
instance star :: (real_algebra_1) real_algebra_1 ..
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    75
20584
60b1d52a455d added classes real_div_algebra and real_field; added lemmas
huffman
parents: 20555
diff changeset
    76
instance star :: (real_div_algebra) real_div_algebra ..
60b1d52a455d added classes real_div_algebra and real_field; added lemmas
huffman
parents: 20555
diff changeset
    77
60b1d52a455d added classes real_div_algebra and real_field; added lemmas
huffman
parents: 20555
diff changeset
    78
instance star :: (real_field) real_field ..
60b1d52a455d added classes real_div_algebra and real_field; added lemmas
huffman
parents: 20555
diff changeset
    79
20726
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    80
lemma star_of_real_def [transfer_unfold]: "of_real r = star_of (of_real r)"
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    81
by (unfold of_real_def, transfer, rule refl)
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    82
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    83
lemma Standard_of_real [simp]: "of_real r \<in> Standard"
f43214ff6baf add lemmas about Standard, real_of, scaleR
huffman
parents: 20584
diff changeset
    84
by (simp add: star_of_real_def)
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    85
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    86
lemma star_of_of_real [simp]: "star_of (of_real r) = of_real r"
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    87
by transfer (rule refl)
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    88
20729
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    89
lemma of_real_eq_star_of [simp]: "of_real = star_of"
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    90
proof
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    91
  fix r :: real
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    92
  show "of_real r = star_of r"
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    93
    by transfer simp
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    94
qed
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    95
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    96
lemma Reals_eq_Standard: "(Reals :: hypreal set) = Standard"
20765
807c5f7dcb94 rearranged axioms and simp rules for scaleR
huffman
parents: 20753
diff changeset
    97
by (simp add: Reals_def Standard_def)
20729
1b45c35c4e85 add lemmas of_real_eq_star_of, Reals_eq_Standard
huffman
parents: 20726
diff changeset
    98
20555
055d9a1bbddf add instances for real_vector and real_algebra
huffman
parents: 20552
diff changeset
    99
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   100
subsection{*Properties of @{term starrel}*}
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   101
21787
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   102
lemma lemma_starrel_refl [simp]: "x \<in> starrel `` {x}"
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   103
by (simp add: starrel_def)
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   104
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   105
lemma starrel_in_hypreal [simp]: "starrel``{x}:star"
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   106
by (simp add: star_def starrel_def quotient_def, blast)
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   107
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   108
declare Abs_star_inject [simp] Abs_star_inverse [simp]
9edd495b6330 consistent naming for FreeUltrafilterNat lemmas; cleaned up
huffman
parents: 21588
diff changeset
   109
declare equiv_starrel [THEN eq_equiv_class_iff, simp]
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   110
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   111
subsection{*@{term hypreal_of_real}: 
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   112
            the Injection from @{typ real} to @{typ hypreal}*}
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   113
21810
b2d23672b003 generalized some lemmas; removed redundant lemmas; cleaned up some proofs
huffman
parents: 21787
diff changeset
   114
lemma inj_star_of: "inj star_of"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   115
by (rule inj_onI, simp)
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   116
20552
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20245
diff changeset
   117
lemma mem_Rep_star_iff: "(X \<in> Rep_star x) = (x = star_n X)"
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20245
diff changeset
   118
by (cases x, simp add: star_n_def)
2c31dd358c21 generalized types of many constants to work over arbitrary vector spaces;
huffman
parents: 20245
diff changeset
   119
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   120
lemma Rep_star_star_n_iff [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   121
  "(X \<in> Rep_star (star_n Y)) = ({n. Y n = X n} \<in> \<U>)"
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   122
by (simp add: star_n_def)
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   123
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   124
lemma Rep_star_star_n: "X \<in> Rep_star (star_n X)"
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   125
by simp
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   126
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   127
subsection{* Properties of @{term star_n} *}
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   128
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   129
lemma star_n_add:
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   130
  "star_n X + star_n Y = star_n (%n. X n + Y n)"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   131
by (simp only: star_add_def starfun2_star_n)
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   132
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   133
lemma star_n_minus:
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   134
   "- star_n X = star_n (%n. -(X n))"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   135
by (simp only: star_minus_def starfun_star_n)
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   136
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   137
lemma star_n_diff:
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   138
     "star_n X - star_n Y = star_n (%n. X n - Y n)"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   139
by (simp only: star_diff_def starfun2_star_n)
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   140
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   141
lemma star_n_mult:
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   142
  "star_n X * star_n Y = star_n (%n. X n * Y n)"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   143
by (simp only: star_mult_def starfun2_star_n)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   144
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   145
lemma star_n_inverse:
17301
6c82a5c10076 added theorem hypreal_inverse2
huffman
parents: 17298
diff changeset
   146
      "inverse (star_n X) = star_n (%n. inverse(X n))"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   147
by (simp only: star_inverse_def starfun_star_n)
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   148
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   149
lemma star_n_le:
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   150
      "star_n X \<le> star_n Y =  
14365
3d4df8c166ae replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents: 14361
diff changeset
   151
       ({n. X n \<le> Y n} \<in> FreeUltrafilterNat)"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   152
by (simp only: star_le_def starP2_star_n)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   153
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   154
lemma star_n_less:
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   155
      "star_n X < star_n Y = ({n. X n < Y n} \<in> FreeUltrafilterNat)"
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   156
by (simp only: star_less_def starP2_star_n)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   157
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   158
lemma star_n_zero_num: "0 = star_n (%n. 0)"
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   159
by (simp only: star_zero_def star_of_def)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   160
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   161
lemma star_n_one_num: "1 = star_n (%n. 1)"
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   162
by (simp only: star_one_def star_of_def)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   163
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   164
lemma star_n_abs:
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   165
     "abs (star_n X) = star_n (%n. abs (X n))"
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   166
by (simp only: star_abs_def starfun_star_n)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   167
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   168
subsection{*Misc Others*}
14299
0b5c0b0a3eba converted Hyperreal/HyperDef to Isar script
paulson
parents: 13487
diff changeset
   169
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   170
lemma hypreal_not_refl2: "!!(x::hypreal). x < y ==> x \<noteq> y"
15539
333a88244569 comprehensive cleanup, replacing sumr by setsum
nipkow
parents: 15413
diff changeset
   171
by (auto)
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   172
14331
8dbbb7cf3637 re-organized numeric lemmas
paulson
parents: 14329
diff changeset
   173
lemma hypreal_eq_minus_iff: "((x::hypreal) = y) = (x + - y = 0)"
15234
ec91a90c604e simplification tweaks for better arithmetic reasoning
paulson
parents: 15229
diff changeset
   174
by auto
14331
8dbbb7cf3637 re-organized numeric lemmas
paulson
parents: 14329
diff changeset
   175
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   176
lemma hypreal_mult_left_cancel: "(c::hypreal) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
   177
by auto
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   178
    
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   179
lemma hypreal_mult_right_cancel: "(c::hypreal) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
   180
by auto
14329
ff3210fe968f re-organized some hyperreal and real lemmas
paulson
parents: 14305
diff changeset
   181
14301
paulson
parents: 14299
diff changeset
   182
lemma hypreal_omega_gt_zero [simp]: "0 < omega"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   183
by (simp add: omega_def star_n_zero_num star_n_less)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   184
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   185
subsection{*Existence of Infinite Hyperreal Number*}
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   186
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   187
text{*Existence of infinite number not corresponding to any real number.
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   188
Use assumption that member @{term FreeUltrafilterNat} is not finite.*}
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   189
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   190
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   191
text{*A few lemmas first*}
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   192
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   193
lemma lemma_omega_empty_singleton_disj: "{n::nat. x = real n} = {} |  
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   194
      (\<exists>y. {n::nat. x = real n} = {y})"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
   195
by force
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   196
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   197
lemma lemma_finite_omega_set: "finite {n::nat. x = real n}"
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   198
by (cut_tac x = x in lemma_omega_empty_singleton_disj, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   199
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   200
lemma not_ex_hypreal_of_real_eq_omega: 
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   201
      "~ (\<exists>x. hypreal_of_real x = omega)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   202
apply (simp add: omega_def)
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   203
apply (simp add: star_of_def star_n_eq_iff)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   204
apply (auto simp add: real_of_nat_Suc diff_eq_eq [symmetric] 
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
   205
            lemma_finite_omega_set [THEN FreeUltrafilterNat.finite])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   206
done
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   207
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   208
lemma hypreal_of_real_not_eq_omega: "hypreal_of_real x \<noteq> omega"
14705
paulson
parents: 14691
diff changeset
   209
by (insert not_ex_hypreal_of_real_eq_omega, auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   210
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   211
text{*Existence of infinitesimal number also not corresponding to any
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   212
 real number*}
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   213
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   214
lemma lemma_epsilon_empty_singleton_disj:
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   215
     "{n::nat. x = inverse(real(Suc n))} = {} |  
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   216
      (\<exists>y. {n::nat. x = inverse(real(Suc n))} = {y})"
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14378
diff changeset
   217
by auto
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   218
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   219
lemma lemma_finite_epsilon_set: "finite {n. x = inverse(real(Suc n))}"
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   220
by (cut_tac x = x in lemma_epsilon_empty_singleton_disj, auto)
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   221
14705
paulson
parents: 14691
diff changeset
   222
lemma not_ex_hypreal_of_real_eq_epsilon: "~ (\<exists>x. hypreal_of_real x = epsilon)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17301
diff changeset
   223
by (auto simp add: epsilon_def star_of_def star_n_eq_iff
21855
74909ecaf20a remove ultra tactic and redundant FreeUltrafilterNat lemmas
huffman
parents: 21810
diff changeset
   224
                   lemma_finite_epsilon_set [THEN FreeUltrafilterNat.finite])
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   225
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   226
lemma hypreal_of_real_not_eq_epsilon: "hypreal_of_real x \<noteq> epsilon"
14705
paulson
parents: 14691
diff changeset
   227
by (insert not_ex_hypreal_of_real_eq_epsilon, auto)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   228
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   229
lemma hypreal_epsilon_not_zero: "epsilon \<noteq> 0"
17298
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   230
by (simp add: epsilon_def star_zero_def star_of_def star_n_eq_iff
ad73fb6144cf replace type hypreal with real star
huffman
parents: 17290
diff changeset
   231
         del: star_of_zero)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   232
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   233
lemma hypreal_epsilon_inverse_omega: "epsilon = inverse(omega)"
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17318
diff changeset
   234
by (simp add: epsilon_def omega_def star_n_inverse)
14370
b0064703967b simplifications in the hyperreals
paulson
parents: 14369
diff changeset
   235
20753
f45aca87b64e add lemma hypreal_epsilon_gt_zero
huffman
parents: 20729
diff changeset
   236
lemma hypreal_epsilon_gt_zero: "0 < epsilon"
f45aca87b64e add lemma hypreal_epsilon_gt_zero
huffman
parents: 20729
diff changeset
   237
by (simp add: hypreal_epsilon_inverse_omega)
f45aca87b64e add lemma hypreal_epsilon_gt_zero
huffman
parents: 20729
diff changeset
   238
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
   239
end