src/HOL/Hyperreal/HyperNat.thy
changeset 21404 eb85850d3eb7
parent 20740 5a103b43da5a
child 21787 9edd495b6330
equal deleted inserted replaced
21403:dd58f13a8eb4 21404:eb85850d3eb7
    12 begin
    12 begin
    13 
    13 
    14 types hypnat = "nat star"
    14 types hypnat = "nat star"
    15 
    15 
    16 abbreviation
    16 abbreviation
    17   hypnat_of_nat :: "nat => nat star"
    17   hypnat_of_nat :: "nat => nat star" where
    18   "hypnat_of_nat == star_of"
    18   "hypnat_of_nat == star_of"
    19 
    19 
    20 subsection{*Properties Transferred from Naturals*}
    20 subsection{*Properties Transferred from Naturals*}
    21 
    21 
    22 lemma hypnat_minus_zero [simp]: "!!z. z - z = (0::hypnat)"
    22 lemma hypnat_minus_zero [simp]: "!!z. z - z = (0::hypnat)"
   159 
   159 
   160 subsection{*Infinite Hypernatural Numbers -- @{term HNatInfinite}*}
   160 subsection{*Infinite Hypernatural Numbers -- @{term HNatInfinite}*}
   161 
   161 
   162 definition
   162 definition
   163   (* the set of infinite hypernatural numbers *)
   163   (* the set of infinite hypernatural numbers *)
   164   HNatInfinite :: "hypnat set"
   164   HNatInfinite :: "hypnat set" where
   165   "HNatInfinite = {n. n \<notin> Nats}"
   165   "HNatInfinite = {n. n \<notin> Nats}"
   166 
   166 
   167 lemma Nats_not_HNatInfinite_iff: "(x \<in> Nats) = (x \<notin> HNatInfinite)"
   167 lemma Nats_not_HNatInfinite_iff: "(x \<in> Nats) = (x \<notin> HNatInfinite)"
   168 by (simp add: HNatInfinite_def)
   168 by (simp add: HNatInfinite_def)
   169 
   169 
   252 
   252 
   253 subsection{*Existence of an infinite hypernatural number*}
   253 subsection{*Existence of an infinite hypernatural number*}
   254 
   254 
   255 definition
   255 definition
   256   (* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *)
   256   (* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *)
   257   whn :: hypnat
   257   whn :: hypnat where
   258   hypnat_omega_def: "whn = star_n (%n::nat. n)"
   258   hypnat_omega_def: "whn = star_n (%n::nat. n)"
   259 
   259 
   260 lemma hypnat_of_nat_neq_whn: "hypnat_of_nat n \<noteq> whn"
   260 lemma hypnat_of_nat_neq_whn: "hypnat_of_nat n \<noteq> whn"
   261 by (simp add: hypnat_omega_def star_of_def star_n_eq_iff FUFNat.finite)
   261 by (simp add: hypnat_omega_def star_of_def star_n_eq_iff FUFNat.finite)
   262 
   262 
   360 
   360 
   361 subsection{*Embedding of the Hypernaturals into the Hyperreals*}
   361 subsection{*Embedding of the Hypernaturals into the Hyperreals*}
   362 text{*Obtained using the nonstandard extension of the naturals*}
   362 text{*Obtained using the nonstandard extension of the naturals*}
   363 
   363 
   364 definition
   364 definition
   365   hypreal_of_hypnat :: "hypnat => hypreal"
   365   hypreal_of_hypnat :: "hypnat => hypreal" where
   366   "hypreal_of_hypnat = *f* real"
   366   "hypreal_of_hypnat = *f* real"
   367 
   367 
   368 declare hypreal_of_hypnat_def [transfer_unfold]
   368 declare hypreal_of_hypnat_def [transfer_unfold]
   369 
   369 
   370 lemma hypreal_of_hypnat:
   370 lemma hypreal_of_hypnat: