src/HOL/NSA/StarDef.thy
author nipkow
Fri, 06 Mar 2009 17:38:47 +0100
changeset 30313 b2441b0c8d38
parent 30198 922f944f03b2
child 30729 461ee3e49ad3
permissions -rw-r--r--
added lemmas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     1
(*  Title       : HOL/Hyperreal/StarDef.thy
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     2
    ID          : $Id$
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     3
    Author      : Jacques D. Fleuriot and Brian Huffman
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     4
*)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     5
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     6
header {* Construction of Star Types Using Ultrafilters *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     7
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     8
theory StarDef
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     9
imports Filter
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    10
uses ("transfer.ML")
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    11
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    12
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    13
subsection {* A Free Ultrafilter over the Naturals *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    14
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    15
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    16
  FreeUltrafilterNat :: "nat set set"  ("\<U>") where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    17
  "\<U> = (SOME U. freeultrafilter U)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    18
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    19
lemma freeultrafilter_FreeUltrafilterNat: "freeultrafilter \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    20
apply (unfold FreeUltrafilterNat_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    21
apply (rule someI_ex [where P=freeultrafilter])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    22
apply (rule freeultrafilter_Ex)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    23
apply (rule nat_infinite)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    24
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    25
29234
60f7fb56f8cd More porting to new locales.
ballarin
parents: 28562
diff changeset
    26
interpretation FreeUltrafilterNat!: freeultrafilter FreeUltrafilterNat
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    27
by (rule freeultrafilter_FreeUltrafilterNat)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    28
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    29
text {* This rule takes the place of the old ultra tactic *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    30
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    31
lemma ultra:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    32
  "\<lbrakk>{n. P n} \<in> \<U>; {n. P n \<longrightarrow> Q n} \<in> \<U>\<rbrakk> \<Longrightarrow> {n. Q n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    33
by (simp add: Collect_imp_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    34
    FreeUltrafilterNat.Un_iff FreeUltrafilterNat.Compl_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    35
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    36
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    37
subsection {* Definition of @{text star} type constructor *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    38
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    39
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    40
  starrel :: "((nat \<Rightarrow> 'a) \<times> (nat \<Rightarrow> 'a)) set" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    41
  "starrel = {(X,Y). {n. X n = Y n} \<in> \<U>}"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    42
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    43
typedef 'a star = "(UNIV :: (nat \<Rightarrow> 'a) set) // starrel"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    44
by (auto intro: quotientI)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    45
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    46
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    47
  star_n :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a star" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    48
  "star_n X = Abs_star (starrel `` {X})"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    49
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    50
theorem star_cases [case_names star_n, cases type: star]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    51
  "(\<And>X. x = star_n X \<Longrightarrow> P) \<Longrightarrow> P"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    52
by (cases x, unfold star_n_def star_def, erule quotientE, fast)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    53
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    54
lemma all_star_eq: "(\<forall>x. P x) = (\<forall>X. P (star_n X))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    55
by (auto, rule_tac x=x in star_cases, simp)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    56
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    57
lemma ex_star_eq: "(\<exists>x. P x) = (\<exists>X. P (star_n X))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    58
by (auto, rule_tac x=x in star_cases, auto)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    59
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    60
text {* Proving that @{term starrel} is an equivalence relation *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    61
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    62
lemma starrel_iff [iff]: "((X,Y) \<in> starrel) = ({n. X n = Y n} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    63
by (simp add: starrel_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    64
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    65
lemma equiv_starrel: "equiv UNIV starrel"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    66
proof (rule equiv.intro)
30198
922f944f03b2 name changes
nipkow
parents: 29904
diff changeset
    67
  show "refl starrel" by (simp add: refl_on_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    68
  show "sym starrel" by (simp add: sym_def eq_commute)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    69
  show "trans starrel" by (auto intro: transI elim!: ultra)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    70
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    71
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    72
lemmas equiv_starrel_iff =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    73
  eq_equiv_class_iff [OF equiv_starrel UNIV_I UNIV_I]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    74
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    75
lemma starrel_in_star: "starrel``{x} \<in> star"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    76
by (simp add: star_def quotientI)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    77
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    78
lemma star_n_eq_iff: "(star_n X = star_n Y) = ({n. X n = Y n} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    79
by (simp add: star_n_def Abs_star_inject starrel_in_star equiv_starrel_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    80
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    81
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    82
subsection {* Transfer principle *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    83
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    84
text {* This introduction rule starts each transfer proof. *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    85
lemma transfer_start:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    86
  "P \<equiv> {n. Q} \<in> \<U> \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    87
by (subgoal_tac "P \<equiv> Q", simp, simp add: atomize_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    88
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    89
text {*Initialize transfer tactic.*}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    90
use "transfer.ML"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    91
setup Transfer.setup
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    92
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    93
text {* Transfer introduction rules. *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    94
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    95
lemma transfer_ex [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    96
  "\<lbrakk>\<And>X. p (star_n X) \<equiv> {n. P n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    97
    \<Longrightarrow> \<exists>x::'a star. p x \<equiv> {n. \<exists>x. P n x} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    98
by (simp only: ex_star_eq FreeUltrafilterNat.Collect_ex)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    99
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   100
lemma transfer_all [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   101
  "\<lbrakk>\<And>X. p (star_n X) \<equiv> {n. P n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   102
    \<Longrightarrow> \<forall>x::'a star. p x \<equiv> {n. \<forall>x. P n x} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   103
by (simp only: all_star_eq FreeUltrafilterNat.Collect_all)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   104
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   105
lemma transfer_not [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   106
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>\<rbrakk> \<Longrightarrow> \<not> p \<equiv> {n. \<not> P n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   107
by (simp only: FreeUltrafilterNat.Collect_not)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   108
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   109
lemma transfer_conj [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   110
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; q \<equiv> {n. Q n} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   111
    \<Longrightarrow> p \<and> q \<equiv> {n. P n \<and> Q n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   112
by (simp only: FreeUltrafilterNat.Collect_conj)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   113
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   114
lemma transfer_disj [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   115
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; q \<equiv> {n. Q n} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   116
    \<Longrightarrow> p \<or> q \<equiv> {n. P n \<or> Q n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   117
by (simp only: FreeUltrafilterNat.Collect_disj)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   118
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   119
lemma transfer_imp [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   120
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; q \<equiv> {n. Q n} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   121
    \<Longrightarrow> p \<longrightarrow> q \<equiv> {n. P n \<longrightarrow> Q n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   122
by (simp only: imp_conv_disj transfer_disj transfer_not)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   123
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   124
lemma transfer_iff [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   125
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; q \<equiv> {n. Q n} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   126
    \<Longrightarrow> p = q \<equiv> {n. P n = Q n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   127
by (simp only: iff_conv_conj_imp transfer_conj transfer_imp)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   128
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   129
lemma transfer_if_bool [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   130
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; x \<equiv> {n. X n} \<in> \<U>; y \<equiv> {n. Y n} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   131
    \<Longrightarrow> (if p then x else y) \<equiv> {n. if P n then X n else Y n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   132
by (simp only: if_bool_eq_conj transfer_conj transfer_imp transfer_not)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   133
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   134
lemma transfer_eq [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   135
  "\<lbrakk>x \<equiv> star_n X; y \<equiv> star_n Y\<rbrakk> \<Longrightarrow> x = y \<equiv> {n. X n = Y n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   136
by (simp only: star_n_eq_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   137
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   138
lemma transfer_if [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   139
  "\<lbrakk>p \<equiv> {n. P n} \<in> \<U>; x \<equiv> star_n X; y \<equiv> star_n Y\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   140
    \<Longrightarrow> (if p then x else y) \<equiv> star_n (\<lambda>n. if P n then X n else Y n)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   141
apply (rule eq_reflection)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   142
apply (auto simp add: star_n_eq_iff transfer_not elim!: ultra)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   143
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   144
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   145
lemma transfer_fun_eq [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   146
  "\<lbrakk>\<And>X. f (star_n X) = g (star_n X) 
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   147
    \<equiv> {n. F n (X n) = G n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   148
      \<Longrightarrow> f = g \<equiv> {n. F n = G n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   149
by (simp only: expand_fun_eq transfer_all)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   150
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   151
lemma transfer_star_n [transfer_intro]: "star_n X \<equiv> star_n (\<lambda>n. X n)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   152
by (rule reflexive)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   153
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   154
lemma transfer_bool [transfer_intro]: "p \<equiv> {n. p} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   155
by (simp add: atomize_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   156
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   157
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   158
subsection {* Standard elements *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   159
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   160
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   161
  star_of :: "'a \<Rightarrow> 'a star" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   162
  "star_of x == star_n (\<lambda>n. x)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   163
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   164
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   165
  Standard :: "'a star set" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   166
  "Standard = range star_of"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   167
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   168
text {* Transfer tactic should remove occurrences of @{term star_of} *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   169
setup {* Transfer.add_const "StarDef.star_of" *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   170
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   171
declare star_of_def [transfer_intro]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   172
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   173
lemma star_of_inject: "(star_of x = star_of y) = (x = y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   174
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   175
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   176
lemma Standard_star_of [simp]: "star_of x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   177
by (simp add: Standard_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   178
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   179
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   180
subsection {* Internal functions *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   181
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   182
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   183
  Ifun :: "('a \<Rightarrow> 'b) star \<Rightarrow> 'a star \<Rightarrow> 'b star" ("_ \<star> _" [300,301] 300) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   184
  "Ifun f \<equiv> \<lambda>x. Abs_star
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   185
       (\<Union>F\<in>Rep_star f. \<Union>X\<in>Rep_star x. starrel``{\<lambda>n. F n (X n)})"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   186
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   187
lemma Ifun_congruent2:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   188
  "congruent2 starrel starrel (\<lambda>F X. starrel``{\<lambda>n. F n (X n)})"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   189
by (auto simp add: congruent2_def equiv_starrel_iff elim!: ultra)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   190
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   191
lemma Ifun_star_n: "star_n F \<star> star_n X = star_n (\<lambda>n. F n (X n))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   192
by (simp add: Ifun_def star_n_def Abs_star_inverse starrel_in_star
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   193
    UN_equiv_class2 [OF equiv_starrel equiv_starrel Ifun_congruent2])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   194
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   195
text {* Transfer tactic should remove occurrences of @{term Ifun} *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   196
setup {* Transfer.add_const "StarDef.Ifun" *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   197
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   198
lemma transfer_Ifun [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   199
  "\<lbrakk>f \<equiv> star_n F; x \<equiv> star_n X\<rbrakk> \<Longrightarrow> f \<star> x \<equiv> star_n (\<lambda>n. F n (X n))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   200
by (simp only: Ifun_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   201
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   202
lemma Ifun_star_of [simp]: "star_of f \<star> star_of x = star_of (f x)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   203
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   204
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   205
lemma Standard_Ifun [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   206
  "\<lbrakk>f \<in> Standard; x \<in> Standard\<rbrakk> \<Longrightarrow> f \<star> x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   207
by (auto simp add: Standard_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   208
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   209
text {* Nonstandard extensions of functions *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   210
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   211
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   212
  starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a star \<Rightarrow> 'b star)"  ("*f* _" [80] 80) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   213
  "starfun f == \<lambda>x. star_of f \<star> x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   214
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   215
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   216
  starfun2 :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a star \<Rightarrow> 'b star \<Rightarrow> 'c star)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   217
    ("*f2* _" [80] 80) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   218
  "starfun2 f == \<lambda>x y. star_of f \<star> x \<star> y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   219
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   220
declare starfun_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   221
declare starfun2_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   222
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   223
lemma starfun_star_n: "( *f* f) (star_n X) = star_n (\<lambda>n. f (X n))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   224
by (simp only: starfun_def star_of_def Ifun_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   225
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   226
lemma starfun2_star_n:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   227
  "( *f2* f) (star_n X) (star_n Y) = star_n (\<lambda>n. f (X n) (Y n))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   228
by (simp only: starfun2_def star_of_def Ifun_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   229
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   230
lemma starfun_star_of [simp]: "( *f* f) (star_of x) = star_of (f x)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   231
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   232
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   233
lemma starfun2_star_of [simp]: "( *f2* f) (star_of x) = *f* f x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   234
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   235
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   236
lemma Standard_starfun [simp]: "x \<in> Standard \<Longrightarrow> starfun f x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   237
by (simp add: starfun_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   238
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   239
lemma Standard_starfun2 [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   240
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> starfun2 f x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   241
by (simp add: starfun2_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   242
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   243
lemma Standard_starfun_iff:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   244
  assumes inj: "\<And>x y. f x = f y \<Longrightarrow> x = y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   245
  shows "(starfun f x \<in> Standard) = (x \<in> Standard)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   246
proof
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   247
  assume "x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   248
  thus "starfun f x \<in> Standard" by simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   249
next
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   250
  have inj': "\<And>x y. starfun f x = starfun f y \<Longrightarrow> x = y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   251
    using inj by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   252
  assume "starfun f x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   253
  then obtain b where b: "starfun f x = star_of b"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   254
    unfolding Standard_def ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   255
  hence "\<exists>x. starfun f x = star_of b" ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   256
  hence "\<exists>a. f a = b" by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   257
  then obtain a where "f a = b" ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   258
  hence "starfun f (star_of a) = star_of b" by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   259
  with b have "starfun f x = starfun f (star_of a)" by simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   260
  hence "x = star_of a" by (rule inj')
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   261
  thus "x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   262
    unfolding Standard_def by auto
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   263
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   264
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   265
lemma Standard_starfun2_iff:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   266
  assumes inj: "\<And>a b a' b'. f a b = f a' b' \<Longrightarrow> a = a' \<and> b = b'"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   267
  shows "(starfun2 f x y \<in> Standard) = (x \<in> Standard \<and> y \<in> Standard)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   268
proof
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   269
  assume "x \<in> Standard \<and> y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   270
  thus "starfun2 f x y \<in> Standard" by simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   271
next
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   272
  have inj': "\<And>x y z w. starfun2 f x y = starfun2 f z w \<Longrightarrow> x = z \<and> y = w"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   273
    using inj by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   274
  assume "starfun2 f x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   275
  then obtain c where c: "starfun2 f x y = star_of c"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   276
    unfolding Standard_def ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   277
  hence "\<exists>x y. starfun2 f x y = star_of c" by auto
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   278
  hence "\<exists>a b. f a b = c" by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   279
  then obtain a b where "f a b = c" by auto
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   280
  hence "starfun2 f (star_of a) (star_of b) = star_of c"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   281
    by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   282
  with c have "starfun2 f x y = starfun2 f (star_of a) (star_of b)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   283
    by simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   284
  hence "x = star_of a \<and> y = star_of b"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   285
    by (rule inj')
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   286
  thus "x \<in> Standard \<and> y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   287
    unfolding Standard_def by auto
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   288
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   289
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   290
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   291
subsection {* Internal predicates *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   292
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   293
definition unstar :: "bool star \<Rightarrow> bool" where
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   294
  [code del]: "unstar b \<longleftrightarrow> b = star_of True"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   295
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   296
lemma unstar_star_n: "unstar (star_n P) = ({n. P n} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   297
by (simp add: unstar_def star_of_def star_n_eq_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   298
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   299
lemma unstar_star_of [simp]: "unstar (star_of p) = p"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   300
by (simp add: unstar_def star_of_inject)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   301
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   302
text {* Transfer tactic should remove occurrences of @{term unstar} *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   303
setup {* Transfer.add_const "StarDef.unstar" *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   304
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   305
lemma transfer_unstar [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   306
  "p \<equiv> star_n P \<Longrightarrow> unstar p \<equiv> {n. P n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   307
by (simp only: unstar_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   308
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   309
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   310
  starP :: "('a \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> bool"  ("*p* _" [80] 80) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   311
  "*p* P = (\<lambda>x. unstar (star_of P \<star> x))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   312
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   313
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   314
  starP2 :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> 'b star \<Rightarrow> bool"  ("*p2* _" [80] 80) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   315
  "*p2* P = (\<lambda>x y. unstar (star_of P \<star> x \<star> y))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   316
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   317
declare starP_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   318
declare starP2_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   319
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   320
lemma starP_star_n: "( *p* P) (star_n X) = ({n. P (X n)} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   321
by (simp only: starP_def star_of_def Ifun_star_n unstar_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   322
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   323
lemma starP2_star_n:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   324
  "( *p2* P) (star_n X) (star_n Y) = ({n. P (X n) (Y n)} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   325
by (simp only: starP2_def star_of_def Ifun_star_n unstar_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   326
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   327
lemma starP_star_of [simp]: "( *p* P) (star_of x) = P x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   328
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   329
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   330
lemma starP2_star_of [simp]: "( *p2* P) (star_of x) = *p* P x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   331
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   332
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   333
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   334
subsection {* Internal sets *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   335
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   336
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   337
  Iset :: "'a set star \<Rightarrow> 'a star set" where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   338
  "Iset A = {x. ( *p2* op \<in>) x A}"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   339
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   340
lemma Iset_star_n:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   341
  "(star_n X \<in> Iset (star_n A)) = ({n. X n \<in> A n} \<in> \<U>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   342
by (simp add: Iset_def starP2_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   343
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   344
text {* Transfer tactic should remove occurrences of @{term Iset} *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   345
setup {* Transfer.add_const "StarDef.Iset" *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   346
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   347
lemma transfer_mem [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   348
  "\<lbrakk>x \<equiv> star_n X; a \<equiv> Iset (star_n A)\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   349
    \<Longrightarrow> x \<in> a \<equiv> {n. X n \<in> A n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   350
by (simp only: Iset_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   351
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   352
lemma transfer_Collect [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   353
  "\<lbrakk>\<And>X. p (star_n X) \<equiv> {n. P n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   354
    \<Longrightarrow> Collect p \<equiv> Iset (star_n (\<lambda>n. Collect (P n)))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   355
by (simp add: atomize_eq expand_set_eq all_star_eq Iset_star_n)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   356
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   357
lemma transfer_set_eq [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   358
  "\<lbrakk>a \<equiv> Iset (star_n A); b \<equiv> Iset (star_n B)\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   359
    \<Longrightarrow> a = b \<equiv> {n. A n = B n} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   360
by (simp only: expand_set_eq transfer_all transfer_iff transfer_mem)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   361
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   362
lemma transfer_ball [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   363
  "\<lbrakk>a \<equiv> Iset (star_n A); \<And>X. p (star_n X) \<equiv> {n. P n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   364
    \<Longrightarrow> \<forall>x\<in>a. p x \<equiv> {n. \<forall>x\<in>A n. P n x} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   365
by (simp only: Ball_def transfer_all transfer_imp transfer_mem)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   366
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   367
lemma transfer_bex [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   368
  "\<lbrakk>a \<equiv> Iset (star_n A); \<And>X. p (star_n X) \<equiv> {n. P n (X n)} \<in> \<U>\<rbrakk>
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   369
    \<Longrightarrow> \<exists>x\<in>a. p x \<equiv> {n. \<exists>x\<in>A n. P n x} \<in> \<U>"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   370
by (simp only: Bex_def transfer_ex transfer_conj transfer_mem)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   371
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   372
lemma transfer_Iset [transfer_intro]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   373
  "\<lbrakk>a \<equiv> star_n A\<rbrakk> \<Longrightarrow> Iset a \<equiv> Iset (star_n (\<lambda>n. A n))"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   374
by simp
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   375
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   376
text {* Nonstandard extensions of sets. *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   377
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   378
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   379
  starset :: "'a set \<Rightarrow> 'a star set" ("*s* _" [80] 80) where
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   380
  "starset A = Iset (star_of A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   381
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   382
declare starset_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   383
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   384
lemma starset_mem: "(star_of x \<in> *s* A) = (x \<in> A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   385
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   386
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   387
lemma starset_UNIV: "*s* (UNIV::'a set) = (UNIV::'a star set)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   388
by (transfer UNIV_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   389
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   390
lemma starset_empty: "*s* {} = {}"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   391
by (transfer empty_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   392
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   393
lemma starset_insert: "*s* (insert x A) = insert (star_of x) ( *s* A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   394
by (transfer insert_def Un_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   395
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   396
lemma starset_Un: "*s* (A \<union> B) = *s* A \<union> *s* B"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   397
by (transfer Un_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   398
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   399
lemma starset_Int: "*s* (A \<inter> B) = *s* A \<inter> *s* B"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   400
by (transfer Int_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   401
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   402
lemma starset_Compl: "*s* -A = -( *s* A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   403
by (transfer Compl_eq, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   404
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   405
lemma starset_diff: "*s* (A - B) = *s* A - *s* B"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   406
by (transfer set_diff_eq, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   407
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   408
lemma starset_image: "*s* (f ` A) = ( *f* f) ` ( *s* A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   409
by (transfer image_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   410
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   411
lemma starset_vimage: "*s* (f -` A) = ( *f* f) -` ( *s* A)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   412
by (transfer vimage_def, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   413
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   414
lemma starset_subset: "( *s* A \<subseteq> *s* B) = (A \<subseteq> B)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   415
by (transfer subset_eq, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   416
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   417
lemma starset_eq: "( *s* A = *s* B) = (A = B)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   418
by (transfer, rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   419
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   420
lemmas starset_simps [simp] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   421
  starset_mem     starset_UNIV
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   422
  starset_empty   starset_insert
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   423
  starset_Un      starset_Int
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   424
  starset_Compl   starset_diff
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   425
  starset_image   starset_vimage
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   426
  starset_subset  starset_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   427
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   428
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   429
subsection {* Syntactic classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   430
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   431
instantiation star :: (zero) zero
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   432
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   433
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   434
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   435
  star_zero_def [code del]:    "0 \<equiv> star_of 0"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   436
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   437
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   438
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   439
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   440
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   441
instantiation star :: (one) one
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   442
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   443
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   444
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   445
  star_one_def [code del]:     "1 \<equiv> star_of 1"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   446
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   447
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   448
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   449
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   450
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   451
instantiation star :: (plus) plus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   452
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   453
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   454
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   455
  star_add_def [code del]:     "(op +) \<equiv> *f2* (op +)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   456
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   457
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   458
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   459
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   460
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   461
instantiation star :: (times) times
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   462
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   463
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   464
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   465
  star_mult_def [code del]:    "(op *) \<equiv> *f2* (op *)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   466
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   467
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   469
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   470
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   471
instantiation star :: (uminus) uminus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   472
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   473
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   474
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   475
  star_minus_def [code del]:   "uminus \<equiv> *f* uminus"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   476
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   477
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   478
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   479
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   480
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   481
instantiation star :: (minus) minus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   482
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   483
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   484
definition
28562
4e74209f113e `code func` now just `code`
haftmann
parents: 28059
diff changeset
   485
  star_diff_def [code del]:    "(op -) \<equiv> *f2* (op -)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   486
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   487
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   488
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   489
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   490
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   491
instantiation star :: (abs) abs
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   492
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   493
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   494
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   495
  star_abs_def:     "abs \<equiv> *f* abs"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   496
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   497
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   498
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   499
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   500
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   501
instantiation star :: (sgn) sgn
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   502
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   503
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   504
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   505
  star_sgn_def:     "sgn \<equiv> *f* sgn"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   506
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   507
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   508
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   509
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   510
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   511
instantiation star :: (inverse) inverse
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   512
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   513
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   514
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   515
  star_divide_def:  "(op /) \<equiv> *f2* (op /)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   516
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   517
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   518
  star_inverse_def: "inverse \<equiv> *f* inverse"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   519
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   520
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   521
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   522
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   523
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   524
instantiation star :: (number) number
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   525
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   526
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   527
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   528
  star_number_def:  "number_of b \<equiv> star_of (number_of b)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   529
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   530
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   531
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   532
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   533
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27468
diff changeset
   534
instance star :: (Ring_and_Field.dvd) Ring_and_Field.dvd ..
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27468
diff changeset
   535
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   536
instantiation star :: (Divides.div) Divides.div
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   537
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   538
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   539
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   540
  star_div_def:     "(op div) \<equiv> *f2* (op div)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   541
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   542
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   543
  star_mod_def:     "(op mod) \<equiv> *f2* (op mod)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   544
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   545
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   546
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   547
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   548
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   549
instantiation star :: (power) power
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   550
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   551
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   552
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   553
  star_power_def:   "(op ^) \<equiv> \<lambda>x n. ( *f* (\<lambda>x. x ^ n)) x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   554
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   555
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   556
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   557
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   558
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   559
instantiation star :: (ord) ord
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   560
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   561
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   562
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   563
  star_le_def:      "(op \<le>) \<equiv> *p2* (op \<le>)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   564
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   565
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   566
  star_less_def:    "(op <) \<equiv> *p2* (op <)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   567
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   568
instance ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   569
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   570
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   571
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   572
lemmas star_class_defs [transfer_unfold] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   573
  star_zero_def     star_one_def      star_number_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   574
  star_add_def      star_diff_def     star_minus_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   575
  star_mult_def     star_divide_def   star_inverse_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   576
  star_le_def       star_less_def     star_abs_def       star_sgn_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   577
  star_div_def      star_mod_def      star_power_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   578
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   579
text {* Class operations preserve standard elements *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   580
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   581
lemma Standard_zero: "0 \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   582
by (simp add: star_zero_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   583
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   584
lemma Standard_one: "1 \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   585
by (simp add: star_one_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   586
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   587
lemma Standard_number_of: "number_of b \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   588
by (simp add: star_number_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   589
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   590
lemma Standard_add: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x + y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   591
by (simp add: star_add_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   592
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   593
lemma Standard_diff: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x - y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   594
by (simp add: star_diff_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   595
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   596
lemma Standard_minus: "x \<in> Standard \<Longrightarrow> - x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   597
by (simp add: star_minus_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   598
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   599
lemma Standard_mult: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x * y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   600
by (simp add: star_mult_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   601
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   602
lemma Standard_divide: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x / y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   603
by (simp add: star_divide_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   604
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   605
lemma Standard_inverse: "x \<in> Standard \<Longrightarrow> inverse x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   606
by (simp add: star_inverse_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   607
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   608
lemma Standard_abs: "x \<in> Standard \<Longrightarrow> abs x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   609
by (simp add: star_abs_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   610
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   611
lemma Standard_div: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x div y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   612
by (simp add: star_div_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   613
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   614
lemma Standard_mod: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x mod y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   615
by (simp add: star_mod_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   616
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   617
lemma Standard_power: "x \<in> Standard \<Longrightarrow> x ^ n \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   618
by (simp add: star_power_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   619
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   620
lemmas Standard_simps [simp] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   621
  Standard_zero  Standard_one  Standard_number_of
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   622
  Standard_add  Standard_diff  Standard_minus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   623
  Standard_mult  Standard_divide  Standard_inverse
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   624
  Standard_abs  Standard_div  Standard_mod
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   625
  Standard_power
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   626
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   627
text {* @{term star_of} preserves class operations *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   628
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   629
lemma star_of_add: "star_of (x + y) = star_of x + star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   630
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   631
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   632
lemma star_of_diff: "star_of (x - y) = star_of x - star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   633
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   634
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   635
lemma star_of_minus: "star_of (-x) = - star_of x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   636
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   637
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   638
lemma star_of_mult: "star_of (x * y) = star_of x * star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   639
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   640
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   641
lemma star_of_divide: "star_of (x / y) = star_of x / star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   642
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   643
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   644
lemma star_of_inverse: "star_of (inverse x) = inverse (star_of x)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   645
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   646
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   647
lemma star_of_div: "star_of (x div y) = star_of x div star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   648
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   649
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   650
lemma star_of_mod: "star_of (x mod y) = star_of x mod star_of y"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   651
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   652
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   653
lemma star_of_power: "star_of (x ^ n) = star_of x ^ n"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   654
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   655
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   656
lemma star_of_abs: "star_of (abs x) = abs (star_of x)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   657
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   658
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   659
text {* @{term star_of} preserves numerals *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   660
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   661
lemma star_of_zero: "star_of 0 = 0"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   662
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   663
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   664
lemma star_of_one: "star_of 1 = 1"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   665
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   666
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   667
lemma star_of_number_of: "star_of (number_of x) = number_of x"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   668
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   669
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   670
text {* @{term star_of} preserves orderings *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   671
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   672
lemma star_of_less: "(star_of x < star_of y) = (x < y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   673
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   674
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   675
lemma star_of_le: "(star_of x \<le> star_of y) = (x \<le> y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   676
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   677
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   678
lemma star_of_eq: "(star_of x = star_of y) = (x = y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   679
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   680
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   681
text{*As above, for 0*}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   682
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   683
lemmas star_of_0_less = star_of_less [of 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   684
lemmas star_of_0_le   = star_of_le   [of 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   685
lemmas star_of_0_eq   = star_of_eq   [of 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   686
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   687
lemmas star_of_less_0 = star_of_less [of _ 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   688
lemmas star_of_le_0   = star_of_le   [of _ 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   689
lemmas star_of_eq_0   = star_of_eq   [of _ 0, simplified star_of_zero]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   690
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   691
text{*As above, for 1*}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   692
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   693
lemmas star_of_1_less = star_of_less [of 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   694
lemmas star_of_1_le   = star_of_le   [of 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   695
lemmas star_of_1_eq   = star_of_eq   [of 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   696
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   697
lemmas star_of_less_1 = star_of_less [of _ 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   698
lemmas star_of_le_1   = star_of_le   [of _ 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   699
lemmas star_of_eq_1   = star_of_eq   [of _ 1, simplified star_of_one]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   700
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   701
text{*As above, for numerals*}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   702
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   703
lemmas star_of_number_less =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   704
  star_of_less [of "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   705
lemmas star_of_number_le   =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   706
  star_of_le   [of "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   707
lemmas star_of_number_eq   =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   708
  star_of_eq   [of "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   709
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   710
lemmas star_of_less_number =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   711
  star_of_less [of _ "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   712
lemmas star_of_le_number   =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   713
  star_of_le   [of _ "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   714
lemmas star_of_eq_number   =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   715
  star_of_eq   [of _ "number_of w", standard, simplified star_of_number_of]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   716
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   717
lemmas star_of_simps [simp] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   718
  star_of_add     star_of_diff    star_of_minus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   719
  star_of_mult    star_of_divide  star_of_inverse
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   720
  star_of_div     star_of_mod
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   721
  star_of_power   star_of_abs
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   722
  star_of_zero    star_of_one     star_of_number_of
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   723
  star_of_less    star_of_le      star_of_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   724
  star_of_0_less  star_of_0_le    star_of_0_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   725
  star_of_less_0  star_of_le_0    star_of_eq_0
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   726
  star_of_1_less  star_of_1_le    star_of_1_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   727
  star_of_less_1  star_of_le_1    star_of_eq_1
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   728
  star_of_number_less star_of_number_le star_of_number_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   729
  star_of_less_number star_of_le_number star_of_eq_number
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   730
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   731
subsection {* Ordering and lattice classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   732
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   733
instance star :: (order) order
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   734
apply (intro_classes)
27682
25aceefd4786 added class preorder
haftmann
parents: 27651
diff changeset
   735
apply (transfer, rule less_le_not_le)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   736
apply (transfer, rule order_refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   737
apply (transfer, erule (1) order_trans)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   738
apply (transfer, erule (1) order_antisym)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   739
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   740
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   741
instantiation star :: (lower_semilattice) lower_semilattice
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   742
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   743
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   744
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   745
  star_inf_def [transfer_unfold]: "inf \<equiv> *f2* inf"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   746
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   747
instance
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   748
  by default (transfer star_inf_def, auto)+
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   749
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   750
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   751
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   752
instantiation star :: (upper_semilattice) upper_semilattice
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   753
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   754
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   755
definition
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   756
  star_sup_def [transfer_unfold]: "sup \<equiv> *f2* sup"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   757
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   758
instance
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   759
  by default (transfer star_sup_def, auto)+
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   760
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   761
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   762
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   763
instance star :: (lattice) lattice ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   764
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   765
instance star :: (distrib_lattice) distrib_lattice
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   766
  by default (transfer, auto simp add: sup_inf_distrib1)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   767
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   768
lemma Standard_inf [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   769
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> inf x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   770
by (simp add: star_inf_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   771
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   772
lemma Standard_sup [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   773
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> sup x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   774
by (simp add: star_sup_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   775
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   776
lemma star_of_inf [simp]: "star_of (inf x y) = inf (star_of x) (star_of y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   777
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   778
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   779
lemma star_of_sup [simp]: "star_of (sup x y) = sup (star_of x) (star_of y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   780
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   781
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   782
instance star :: (linorder) linorder
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   783
by (intro_classes, transfer, rule linorder_linear)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   784
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   785
lemma star_max_def [transfer_unfold]: "max = *f2* max"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   786
apply (rule ext, rule ext)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   787
apply (unfold max_def, transfer, fold max_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   788
apply (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   789
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   790
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   791
lemma star_min_def [transfer_unfold]: "min = *f2* min"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   792
apply (rule ext, rule ext)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   793
apply (unfold min_def, transfer, fold min_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   794
apply (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   795
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   796
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   797
lemma Standard_max [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   798
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> max x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   799
by (simp add: star_max_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   800
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   801
lemma Standard_min [simp]:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   802
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> min x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   803
by (simp add: star_min_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   804
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   805
lemma star_of_max [simp]: "star_of (max x y) = max (star_of x) (star_of y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   806
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   807
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   808
lemma star_of_min [simp]: "star_of (min x y) = min (star_of x) (star_of y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   809
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   810
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   811
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   812
subsection {* Ordered group classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   813
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   814
instance star :: (semigroup_add) semigroup_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   815
by (intro_classes, transfer, rule add_assoc)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   816
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   817
instance star :: (ab_semigroup_add) ab_semigroup_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   818
by (intro_classes, transfer, rule add_commute)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   819
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   820
instance star :: (semigroup_mult) semigroup_mult
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   821
by (intro_classes, transfer, rule mult_assoc)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   822
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   823
instance star :: (ab_semigroup_mult) ab_semigroup_mult
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   824
by (intro_classes, transfer, rule mult_commute)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   825
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   826
instance star :: (comm_monoid_add) comm_monoid_add
28059
295a8fc92684 fixed names of class assumptions
haftmann
parents: 27682
diff changeset
   827
by (intro_classes, transfer, rule comm_monoid_add_class.add_0)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   828
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   829
instance star :: (monoid_mult) monoid_mult
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   830
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   831
apply (transfer, rule mult_1_left)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   832
apply (transfer, rule mult_1_right)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   833
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   834
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   835
instance star :: (comm_monoid_mult) comm_monoid_mult
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   836
by (intro_classes, transfer, rule mult_1)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   837
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   838
instance star :: (cancel_semigroup_add) cancel_semigroup_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   839
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   840
apply (transfer, erule add_left_imp_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   841
apply (transfer, erule add_right_imp_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   842
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   843
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   844
instance star :: (cancel_ab_semigroup_add) cancel_ab_semigroup_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   845
by (intro_classes, transfer, rule add_imp_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   846
29904
856f16a3b436 add class cancel_comm_monoid_add
huffman
parents: 29234
diff changeset
   847
instance star :: (cancel_comm_monoid_add) cancel_comm_monoid_add ..
856f16a3b436 add class cancel_comm_monoid_add
huffman
parents: 29234
diff changeset
   848
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   849
instance star :: (ab_group_add) ab_group_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   850
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   851
apply (transfer, rule left_minus)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   852
apply (transfer, rule diff_minus)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   853
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   854
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   855
instance star :: (pordered_ab_semigroup_add) pordered_ab_semigroup_add
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   856
by (intro_classes, transfer, rule add_left_mono)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   857
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   858
instance star :: (pordered_cancel_ab_semigroup_add) pordered_cancel_ab_semigroup_add ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   859
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   860
instance star :: (pordered_ab_semigroup_add_imp_le) pordered_ab_semigroup_add_imp_le
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   861
by (intro_classes, transfer, rule add_le_imp_le_left)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   862
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   863
instance star :: (pordered_comm_monoid_add) pordered_comm_monoid_add ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   864
instance star :: (pordered_ab_group_add) pordered_ab_group_add ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   865
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   866
instance star :: (pordered_ab_group_add_abs) pordered_ab_group_add_abs 
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   867
  by intro_classes (transfer,
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   868
    simp add: abs_ge_self abs_leI abs_triangle_ineq)+
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   869
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   870
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   871
instance star :: (lordered_ab_group_add_meet) lordered_ab_group_add_meet ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   872
instance star :: (lordered_ab_group_add_meet) lordered_ab_group_add_meet ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   873
instance star :: (lordered_ab_group_add) lordered_ab_group_add ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   874
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   875
instance star :: (lordered_ab_group_add_abs) lordered_ab_group_add_abs
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   876
by (intro_classes, transfer, rule abs_lattice)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   877
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   878
subsection {* Ring and field classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   879
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   880
instance star :: (semiring) semiring
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   881
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   882
apply (transfer, rule left_distrib)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   883
apply (transfer, rule right_distrib)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   884
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   885
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   886
instance star :: (semiring_0) semiring_0 
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   887
by intro_classes (transfer, simp)+
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   888
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   889
instance star :: (semiring_0_cancel) semiring_0_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   890
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   891
instance star :: (comm_semiring) comm_semiring 
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   892
by (intro_classes, transfer, rule left_distrib)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   893
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   894
instance star :: (comm_semiring_0) comm_semiring_0 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   895
instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   896
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   897
instance star :: (zero_neq_one) zero_neq_one
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   898
by (intro_classes, transfer, rule zero_neq_one)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   899
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   900
instance star :: (semiring_1) semiring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   901
instance star :: (comm_semiring_1) comm_semiring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   902
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   903
instance star :: (no_zero_divisors) no_zero_divisors
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   904
by (intro_classes, transfer, rule no_zero_divisors)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   905
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   906
instance star :: (semiring_1_cancel) semiring_1_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   907
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   908
instance star :: (ring) ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   909
instance star :: (comm_ring) comm_ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   910
instance star :: (ring_1) ring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   911
instance star :: (comm_ring_1) comm_ring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   912
instance star :: (ring_no_zero_divisors) ring_no_zero_divisors ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   913
instance star :: (ring_1_no_zero_divisors) ring_1_no_zero_divisors ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   914
instance star :: (idom) idom .. 
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   915
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   916
instance star :: (division_ring) division_ring
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   917
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   918
apply (transfer, erule left_inverse)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   919
apply (transfer, erule right_inverse)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   920
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   921
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   922
instance star :: (field) field
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   923
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   924
apply (transfer, erule left_inverse)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   925
apply (transfer, rule divide_inverse)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   926
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   927
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   928
instance star :: (division_by_zero) division_by_zero
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   929
by (intro_classes, transfer, rule inverse_zero)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   930
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   931
instance star :: (pordered_semiring) pordered_semiring
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   932
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   933
apply (transfer, erule (1) mult_left_mono)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   934
apply (transfer, erule (1) mult_right_mono)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   935
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   936
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   937
instance star :: (pordered_cancel_semiring) pordered_cancel_semiring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   938
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   939
instance star :: (ordered_semiring_strict) ordered_semiring_strict
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   940
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   941
apply (transfer, erule (1) mult_strict_left_mono)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   942
apply (transfer, erule (1) mult_strict_right_mono)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   943
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   944
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   945
instance star :: (pordered_comm_semiring) pordered_comm_semiring
28059
295a8fc92684 fixed names of class assumptions
haftmann
parents: 27682
diff changeset
   946
by (intro_classes, transfer, rule mult_mono1_class.mult_mono1)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   947
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   948
instance star :: (pordered_cancel_comm_semiring) pordered_cancel_comm_semiring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   949
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   950
instance star :: (ordered_comm_semiring_strict) ordered_comm_semiring_strict
28059
295a8fc92684 fixed names of class assumptions
haftmann
parents: 27682
diff changeset
   951
by (intro_classes, transfer, rule ordered_comm_semiring_strict_class.mult_strict_left_mono_comm)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   952
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   953
instance star :: (pordered_ring) pordered_ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   954
instance star :: (pordered_ring_abs) pordered_ring_abs
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   955
  by intro_classes  (transfer, rule abs_eq_mult)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   956
instance star :: (lordered_ring) lordered_ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   957
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   958
instance star :: (abs_if) abs_if
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   959
by (intro_classes, transfer, rule abs_if)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   960
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   961
instance star :: (sgn_if) sgn_if
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   962
by (intro_classes, transfer, rule sgn_if)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   963
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   964
instance star :: (ordered_ring_strict) ordered_ring_strict ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   965
instance star :: (pordered_comm_ring) pordered_comm_ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   966
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   967
instance star :: (ordered_semidom) ordered_semidom
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   968
by (intro_classes, transfer, rule zero_less_one)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   969
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   970
instance star :: (ordered_idom) ordered_idom ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   971
instance star :: (ordered_field) ordered_field ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   972
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   973
subsection {* Power classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   974
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   975
text {*
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   976
  Proving the class axiom @{thm [source] power_Suc} for type
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   977
  @{typ "'a star"} is a little tricky, because it quantifies
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   978
  over values of type @{typ nat}. The transfer principle does
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   979
  not handle quantification over non-star types in general,
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   980
  but we can work around this by fixing an arbitrary @{typ nat}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   981
  value, and then applying the transfer principle.
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   982
*}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   983
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   984
instance star :: (recpower) recpower
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   985
proof
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   986
  show "\<And>a::'a star. a ^ 0 = 1"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   987
    by transfer (rule power_0)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   988
next
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   989
  fix n show "\<And>a::'a star. a ^ Suc n = a * a ^ n"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   990
    by transfer (rule power_Suc)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   991
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   992
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   993
subsection {* Number classes *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   994
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   995
lemma star_of_nat_def [transfer_unfold]: "of_nat n = star_of (of_nat n)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   996
by (induct n, simp_all)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   997
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   998
lemma Standard_of_nat [simp]: "of_nat n \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   999
by (simp add: star_of_nat_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1000
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1001
lemma star_of_of_nat [simp]: "star_of (of_nat n) = of_nat n"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1002
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1003
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1004
lemma star_of_int_def [transfer_unfold]: "of_int z = star_of (of_int z)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1005
by (rule_tac z=z in int_diff_cases, simp)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1006
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1007
lemma Standard_of_int [simp]: "of_int z \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1008
by (simp add: star_of_int_def)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1009
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1010
lemma star_of_of_int [simp]: "star_of (of_int z) = of_int z"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1011
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1012
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1013
instance star :: (semiring_char_0) semiring_char_0
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1014
by intro_classes (simp only: star_of_nat_def star_of_eq of_nat_eq_iff)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1015
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1016
instance star :: (ring_char_0) ring_char_0 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1017
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1018
instance star :: (number_ring) number_ring
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1019
by (intro_classes, simp only: star_number_def star_of_int_def number_of_eq)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1020
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1021
subsection {* Finite class *}
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1022
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1023
lemma starset_finite: "finite A \<Longrightarrow> *s* A = star_of ` A"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1024
by (erule finite_induct, simp_all)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1025
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1026
instance star :: (finite) finite
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1027
apply (intro_classes)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1028
apply (subst starset_UNIV [symmetric])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1029
apply (subst starset_finite [OF finite])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1030
apply (rule finite_imageI [OF finite])
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1031
done
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1032
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
  1033
end