src/HOL/Nonstandard_Analysis/StarDef.thy
changeset 67399 eab6ce8368fa
parent 66815 93c6632ddf44
child 67635 28f926146986
equal deleted inserted replaced
67398:5eb932e604a2 67399:eab6ce8368fa
   302 
   302 
   303 
   303 
   304 subsection \<open>Internal sets\<close>
   304 subsection \<open>Internal sets\<close>
   305 
   305 
   306 definition Iset :: "'a set star \<Rightarrow> 'a star set"
   306 definition Iset :: "'a set star \<Rightarrow> 'a star set"
   307   where "Iset A = {x. ( *p2* op \<in>) x A}"
   307   where "Iset A = {x. ( *p2* (\<in>)) x A}"
   308 
   308 
   309 lemma Iset_star_n: "(star_n X \<in> Iset (star_n A)) = (eventually (\<lambda>n. X n \<in> A n) \<U>)"
   309 lemma Iset_star_n: "(star_n X \<in> Iset (star_n A)) = (eventually (\<lambda>n. X n \<in> A n) \<U>)"
   310   by (simp add: Iset_def starP2_star_n)
   310   by (simp add: Iset_def starP2_star_n)
   311 
   311 
   312 text \<open>Transfer tactic should remove occurrences of @{term Iset}.\<close>
   312 text \<open>Transfer tactic should remove occurrences of @{term Iset}.\<close>
   405   instance ..
   405   instance ..
   406 end
   406 end
   407 
   407 
   408 instantiation star :: (plus) plus
   408 instantiation star :: (plus) plus
   409 begin
   409 begin
   410   definition star_add_def: "(op +) \<equiv> *f2* (op +)"
   410   definition star_add_def: "(+) \<equiv> *f2* (+)"
   411   instance ..
   411   instance ..
   412 end
   412 end
   413 
   413 
   414 instantiation star :: (times) times
   414 instantiation star :: (times) times
   415 begin
   415 begin
   416   definition star_mult_def: "(op *) \<equiv> *f2* (op *)"
   416   definition star_mult_def: "(( * )) \<equiv> *f2* (( * ))"
   417   instance ..
   417   instance ..
   418 end
   418 end
   419 
   419 
   420 instantiation star :: (uminus) uminus
   420 instantiation star :: (uminus) uminus
   421 begin
   421 begin
   423   instance ..
   423   instance ..
   424 end
   424 end
   425 
   425 
   426 instantiation star :: (minus) minus
   426 instantiation star :: (minus) minus
   427 begin
   427 begin
   428   definition star_diff_def: "(op -) \<equiv> *f2* (op -)"
   428   definition star_diff_def: "(-) \<equiv> *f2* (-)"
   429   instance ..
   429   instance ..
   430 end
   430 end
   431 
   431 
   432 instantiation star :: (abs) abs
   432 instantiation star :: (abs) abs
   433 begin
   433 begin
   455 
   455 
   456 instance star :: (Rings.dvd) Rings.dvd ..
   456 instance star :: (Rings.dvd) Rings.dvd ..
   457 
   457 
   458 instantiation star :: (modulo) modulo
   458 instantiation star :: (modulo) modulo
   459 begin
   459 begin
   460   definition star_mod_def: "(op mod) \<equiv> *f2* (op mod)"
   460   definition star_mod_def: "(mod) \<equiv> *f2* (mod)"
   461   instance ..
   461   instance ..
   462 end
   462 end
   463 
   463 
   464 instantiation star :: (ord) ord
   464 instantiation star :: (ord) ord
   465 begin
   465 begin
   466   definition star_le_def: "(op \<le>) \<equiv> *p2* (op \<le>)"
   466   definition star_le_def: "(\<le>) \<equiv> *p2* (\<le>)"
   467   definition star_less_def: "(op <) \<equiv> *p2* (op <)"
   467   definition star_less_def: "(<) \<equiv> *p2* (<)"
   468   instance ..
   468   instance ..
   469 end
   469 end
   470 
   470 
   471 lemmas star_class_defs [transfer_unfold] =
   471 lemmas star_class_defs [transfer_unfold] =
   472   star_zero_def     star_one_def
   472   star_zero_def     star_one_def
   839 
   839 
   840 
   840 
   841 
   841 
   842 subsection \<open>Power\<close>
   842 subsection \<open>Power\<close>
   843 
   843 
   844 lemma star_power_def [transfer_unfold]: "(op ^) \<equiv> \<lambda>x n. ( *f* (\<lambda>x. x ^ n)) x"
   844 lemma star_power_def [transfer_unfold]: "(^) \<equiv> \<lambda>x n. ( *f* (\<lambda>x. x ^ n)) x"
   845 proof (rule eq_reflection, rule ext, rule ext)
   845 proof (rule eq_reflection, rule ext, rule ext)
   846   show "x ^ n = ( *f* (\<lambda>x. x ^ n)) x" for n :: nat and x :: "'a star"
   846   show "x ^ n = ( *f* (\<lambda>x. x ^ n)) x" for n :: nat and x :: "'a star"
   847   proof (induct n arbitrary: x)
   847   proof (induct n arbitrary: x)
   848     case 0
   848     case 0
   849     have "\<And>x::'a star. ( *f* (\<lambda>x. 1)) x = 1"
   849     have "\<And>x::'a star. ( *f* (\<lambda>x. 1)) x = 1"