src/HOL/Nonstandard_Analysis/StarDef.thy
author haftmann
Thu, 19 Jun 2025 17:15:40 +0200
changeset 82734 89347c0cc6a3
parent 82248 e8c96013ea8a
permissions -rw-r--r--
treat map_filter similar to list_all, list_ex, list_ex1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62479
716336f19aa9 clarified session;
wenzelm
parents: 62378
diff changeset
     1
(*  Title:      HOL/Nonstandard_Analysis/StarDef.thy
716336f19aa9 clarified session;
wenzelm
parents: 62378
diff changeset
     2
    Author:     Jacques D. Fleuriot and Brian Huffman
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     3
*)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     4
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
     5
section \<open>Construction of Star Types Using Ultrafilters\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     6
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     7
theory StarDef
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
     8
  imports Free_Ultrafilter
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     9
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    10
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
    11
subsection \<open>A Free Ultrafilter over the Naturals\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    12
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
    13
definition FreeUltrafilterNat :: "nat filter"  (\<open>\<U>\<close>)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    14
  where "\<U> = (SOME U. freeultrafilter U)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    15
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    16
lemma freeultrafilter_FreeUltrafilterNat: "freeultrafilter \<U>"
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
    17
  unfolding FreeUltrafilterNat_def
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
    18
  by (simp add: freeultrafilter_Ex someI_ex)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    19
64438
wenzelm
parents: 64435
diff changeset
    20
interpretation FreeUltrafilterNat: freeultrafilter \<U>
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    21
  by (rule freeultrafilter_FreeUltrafilterNat)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    22
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    23
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
    24
subsection \<open>Definition of \<open>star\<close> type constructor\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    25
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    26
definition starrel :: "((nat \<Rightarrow> 'a) \<times> (nat \<Rightarrow> 'a)) set"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    27
  where "starrel = {(X, Y). eventually (\<lambda>n. X n = Y n) \<U>}"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    28
45694
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 45605
diff changeset
    29
definition "star = (UNIV :: (nat \<Rightarrow> 'a) set) // starrel"
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 45605
diff changeset
    30
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 48891
diff changeset
    31
typedef 'a star = "star :: (nat \<Rightarrow> 'a) set set"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    32
  by (auto simp: star_def intro: quotientI)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    33
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    34
definition star_n :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a star"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    35
  where "star_n X = Abs_star (starrel `` {X})"
27468
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
theorem star_cases [case_names star_n, cases type: star]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    38
  obtains X where "x = star_n X"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    39
  by (cases x) (auto simp: star_n_def star_def elim: quotientE)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    40
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    41
lemma all_star_eq: "(\<forall>x. P x) \<longleftrightarrow> (\<forall>X. P (star_n X))"
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
    42
  by (metis star_cases)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    43
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    44
lemma ex_star_eq: "(\<exists>x. P x) \<longleftrightarrow> (\<exists>X. P (star_n X))"
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
    45
  by (metis star_cases)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    46
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
    47
text \<open>Proving that \<^term>\<open>starrel\<close> is an equivalence relation.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    48
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    49
lemma starrel_iff [iff]: "(X, Y) \<in> starrel \<longleftrightarrow> eventually (\<lambda>n. X n = Y n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    50
  by (simp add: starrel_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    51
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    52
lemma equiv_starrel: "equiv UNIV starrel"
40815
6e2d17cc0d1d equivI has replaced equiv.intro
haftmann
parents: 39302
diff changeset
    53
proof (rule equivI)
82248
e8c96013ea8a changed definition of refl_on
desharna
parents: 81142
diff changeset
    54
  show "starrel \<subseteq> UNIV \<times> UNIV" by simp
30198
922f944f03b2 name changes
nipkow
parents: 29904
diff changeset
    55
  show "refl starrel" by (simp add: refl_on_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    56
  show "sym starrel" by (simp add: sym_def eq_commute)
60041
6c86d58ab0ca replace Filters in NSA by HOL-Filters
hoelzl
parents: 60036
diff changeset
    57
  show "trans starrel" by (intro transI) (auto elim: eventually_elim2)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    58
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    59
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    60
lemmas equiv_starrel_iff = eq_equiv_class_iff [OF equiv_starrel UNIV_I UNIV_I]
27468
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_in_star: "starrel``{x} \<in> star"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    63
  by (simp add: star_def quotientI)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    64
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    65
lemma star_n_eq_iff: "star_n X = star_n Y \<longleftrightarrow> eventually (\<lambda>n. X n = Y n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    66
  by (simp add: star_n_def Abs_star_inject starrel_in_star equiv_starrel_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    67
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    68
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
    69
subsection \<open>Transfer principle\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    70
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
    71
text \<open>This introduction rule starts each transfer proof.\<close>
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    72
lemma transfer_start: "P \<equiv> eventually (\<lambda>n. Q) \<U> \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
60041
6c86d58ab0ca replace Filters in NSA by HOL-Filters
hoelzl
parents: 60036
diff changeset
    73
  by (simp add: FreeUltrafilterNat.proper)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    74
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    75
text \<open>Standard principles that play a central role in the transfer tactic.\<close>
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
    76
definition Ifun :: "('a \<Rightarrow> 'b) star \<Rightarrow> 'a star \<Rightarrow> 'b star"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
    77
    (\<open>(\<open>notation=\<open>infix \<star>\<close>\<close>_ \<star>/ _)\<close> [300, 301] 300)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    78
  where "Ifun f \<equiv>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    79
    \<lambda>x. Abs_star (\<Union>F\<in>Rep_star f. \<Union>X\<in>Rep_star x. starrel``{\<lambda>n. F n (X n)})"
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    80
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    81
lemma Ifun_congruent2: "congruent2 starrel starrel (\<lambda>F X. starrel``{\<lambda>n. F n (X n)})"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    82
  by (auto simp add: congruent2_def equiv_starrel_iff elim!: eventually_rev_mp)
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    83
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    84
lemma Ifun_star_n: "star_n F \<star> star_n X = star_n (\<lambda>n. F n (X n))"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    85
  by (simp add: Ifun_def star_n_def Abs_star_inverse starrel_in_star
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    86
      UN_equiv_class2 [OF equiv_starrel equiv_starrel Ifun_congruent2])
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    87
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    88
lemma transfer_Ifun: "f \<equiv> star_n F \<Longrightarrow> x \<equiv> star_n X \<Longrightarrow> f \<star> x \<equiv> star_n (\<lambda>n. F n (X n))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    89
  by (simp only: Ifun_star_n)
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    90
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    91
definition star_of :: "'a \<Rightarrow> 'a star"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    92
  where "star_of x \<equiv> star_n (\<lambda>n. x)"
64270
bf474d719011 Modified transfer principle in HOL/NSA to cause less ho-unficiation
Simon Wimmer <wimmers@in.tum.de>
parents: 64242
diff changeset
    93
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
    94
text \<open>Initialize transfer tactic.\<close>
69605
a96320074298 isabelle update -u path_cartouches;
wenzelm
parents: 69597
diff changeset
    95
ML_file \<open>transfer_principle.ML\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    96
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    97
method_setup transfer =
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    98
  \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (Transfer_Principle.transfer_tac ctxt ths))\<close>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
    99
  "transfer principle"
47432
e1576d13e933 more standard method setup;
wenzelm
parents: 47328
diff changeset
   100
e1576d13e933 more standard method setup;
wenzelm
parents: 47328
diff changeset
   101
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   102
text \<open>Transfer introduction rules.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   103
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   104
lemma transfer_ex [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   105
  "(\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   106
    \<exists>x::'a star. p x \<equiv> eventually (\<lambda>n. \<exists>x. P n x) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   107
  by (simp only: ex_star_eq eventually_ex)
27468
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_all [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   110
  "(\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   111
    \<forall>x::'a star. p x \<equiv> eventually (\<lambda>n. \<forall>x. P n x) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   112
  by (simp only: all_star_eq FreeUltrafilterNat.eventually_all_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   113
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   114
lemma transfer_not [transfer_intro]: "p \<equiv> eventually P \<U> \<Longrightarrow> \<not> p \<equiv> eventually (\<lambda>n. \<not> P n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   115
  by (simp only: FreeUltrafilterNat.eventually_not_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   116
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   117
lemma transfer_conj [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   118
  "p \<equiv> eventually P \<U> \<Longrightarrow> q \<equiv> eventually Q \<U> \<Longrightarrow> p \<and> q \<equiv> eventually (\<lambda>n. P n \<and> Q n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   119
  by (simp only: eventually_conj_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   120
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   121
lemma transfer_disj [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   122
  "p \<equiv> eventually P \<U> \<Longrightarrow> q \<equiv> eventually Q \<U> \<Longrightarrow> p \<or> q \<equiv> eventually (\<lambda>n. P n \<or> Q n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   123
  by (simp only: FreeUltrafilterNat.eventually_disj_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   124
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   125
lemma transfer_imp [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   126
  "p \<equiv> eventually P \<U> \<Longrightarrow> q \<equiv> eventually Q \<U> \<Longrightarrow> p \<longrightarrow> q \<equiv> eventually (\<lambda>n. P n \<longrightarrow> Q n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   127
  by (simp only: FreeUltrafilterNat.eventually_imp_iff)
27468
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_iff [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   130
  "p \<equiv> eventually P \<U> \<Longrightarrow> q \<equiv> eventually Q \<U> \<Longrightarrow> p = q \<equiv> eventually (\<lambda>n. P n = Q n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   131
  by (simp only: FreeUltrafilterNat.eventually_iff_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   132
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   133
lemma transfer_if_bool [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   134
  "p \<equiv> eventually P \<U> \<Longrightarrow> x \<equiv> eventually X \<U> \<Longrightarrow> y \<equiv> eventually Y \<U> \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   135
    (if p then x else y) \<equiv> eventually (\<lambda>n. if P n then X n else Y n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   136
  by (simp only: if_bool_eq_conj transfer_conj transfer_imp transfer_not)
27468
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_eq [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   139
  "x \<equiv> star_n X \<Longrightarrow> y \<equiv> star_n Y \<Longrightarrow> x = y \<equiv> eventually (\<lambda>n. X n = Y n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   140
  by (simp only: star_n_eq_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   141
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   142
lemma transfer_if [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   143
  "p \<equiv> eventually (\<lambda>n. P n) \<U> \<Longrightarrow> x \<equiv> star_n X \<Longrightarrow> y \<equiv> star_n Y \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   144
    (if p then x else y) \<equiv> star_n (\<lambda>n. if P n then X n else Y n)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   145
  by (rule eq_reflection) (auto simp: star_n_eq_iff transfer_not elim!: eventually_mono)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   146
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   147
lemma transfer_fun_eq [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   148
  "(\<And>X. f (star_n X) = g (star_n X) \<equiv> eventually (\<lambda>n. F n (X n) = G n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   149
    f = g \<equiv> eventually (\<lambda>n. F n = G n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   150
  by (simp only: fun_eq_iff transfer_all)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   151
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   152
lemma transfer_star_n [transfer_intro]: "star_n X \<equiv> star_n (\<lambda>n. X n)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   153
  by (rule reflexive)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   154
60041
6c86d58ab0ca replace Filters in NSA by HOL-Filters
hoelzl
parents: 60036
diff changeset
   155
lemma transfer_bool [transfer_intro]: "p \<equiv> eventually (\<lambda>n. p) \<U>"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   156
  by (simp add: FreeUltrafilterNat.proper)
27468
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
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   159
subsection \<open>Standard elements\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   160
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   161
definition Standard :: "'a star set"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   162
  where "Standard = range star_of"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   163
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   164
text \<open>Transfer tactic should remove occurrences of \<^term>\<open>star_of\<close>.\<close>
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   165
setup \<open>Transfer_Principle.add_const \<^const_name>\<open>star_of\<close>\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   166
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   167
lemma star_of_inject: "star_of x = star_of y \<longleftrightarrow> x = y"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   168
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   169
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   170
lemma Standard_star_of [simp]: "star_of x \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   171
  by (simp add: Standard_def)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   172
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   173
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   174
subsection \<open>Internal functions\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   175
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   176
text \<open>Transfer tactic should remove occurrences of \<^term>\<open>Ifun\<close>.\<close>
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   177
setup \<open>Transfer_Principle.add_const \<^const_name>\<open>Ifun\<close>\<close>
27468
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
lemma Ifun_star_of [simp]: "star_of f \<star> star_of x = star_of (f x)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   180
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   181
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   182
lemma Standard_Ifun [simp]: "f \<in> Standard \<Longrightarrow> x \<in> Standard \<Longrightarrow> f \<star> x \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   183
  by (auto simp add: Standard_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   184
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   185
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   186
text \<open>Nonstandard extensions of functions.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   187
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   188
definition starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a star \<Rightarrow> 'b star"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   189
    (\<open>(\<open>open_block notation=\<open>prefix starfun\<close>\<close>*f* _)\<close> [80] 80)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   190
  where "starfun f \<equiv> \<lambda>x. star_of f \<star> x"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   191
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   192
definition starfun2 :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'a star \<Rightarrow> 'b star \<Rightarrow> 'c star"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   193
    (\<open>(\<open>open_block notation=\<open>prefix starfun2\<close>\<close>*f2* _)\<close> [80] 80)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   194
  where "starfun2 f \<equiv> \<lambda>x y. star_of f \<star> x \<star> y"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   195
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   196
declare starfun_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   197
declare starfun2_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   198
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   199
lemma starfun_star_n: "( *f* f) (star_n X) = star_n (\<lambda>n. f (X n))"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   200
  by (simp only: starfun_def star_of_def Ifun_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   201
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   202
lemma starfun2_star_n: "( *f2* f) (star_n X) (star_n Y) = star_n (\<lambda>n. f (X n) (Y n))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   203
  by (simp only: starfun2_def star_of_def Ifun_star_n)
27468
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 starfun_star_of [simp]: "( *f* f) (star_of x) = star_of (f x)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   206
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   207
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   208
lemma starfun2_star_of [simp]: "( *f2* f) (star_of x) = *f* f x"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   209
  by transfer (rule refl)
27468
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
lemma Standard_starfun [simp]: "x \<in> Standard \<Longrightarrow> starfun f x \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   212
  by (simp add: starfun_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   213
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   214
lemma Standard_starfun2 [simp]: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> starfun2 f x y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   215
  by (simp add: starfun2_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   216
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   217
lemma Standard_starfun_iff:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   218
  assumes inj: "\<And>x y. f x = f y \<Longrightarrow> x = y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   219
  shows "starfun f x \<in> Standard \<longleftrightarrow> x \<in> Standard"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   220
proof
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   221
  assume "x \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   222
  then show "starfun f x \<in> Standard" by simp
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   223
next
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   224
  from inj have inj': "\<And>x y. starfun f x = starfun f y \<Longrightarrow> x = y"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   225
    by transfer
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   226
  assume "starfun f x \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   227
  then obtain b where b: "starfun f x = star_of b"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   228
    unfolding Standard_def ..
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   229
  then have "\<exists>x. starfun f x = star_of b" ..
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   230
  then have "\<exists>a. f a = b" by transfer
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   231
  then obtain a where "f a = b" ..
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   232
  then have "starfun f (star_of a) = star_of b" by transfer
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   233
  with b have "starfun f x = starfun f (star_of a)" by simp
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   234
  then have "x = star_of a" by (rule inj')
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   235
  then show "x \<in> Standard" by (simp add: Standard_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   236
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   237
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   238
lemma Standard_starfun2_iff:
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   239
  assumes inj: "\<And>a b a' b'. f a b = f a' b' \<Longrightarrow> a = a' \<and> b = b'"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   240
  shows "starfun2 f x y \<in> Standard \<longleftrightarrow> x \<in> Standard \<and> y \<in> Standard"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   241
proof
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   242
  assume "x \<in> Standard \<and> y \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   243
  then show "starfun2 f x y \<in> Standard" by simp
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   244
next
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   245
  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
   246
    using inj by transfer
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   247
  assume "starfun2 f x y \<in> Standard"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   248
  then obtain c where c: "starfun2 f x y = star_of c"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   249
    unfolding Standard_def ..
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   250
  then have "\<exists>x y. starfun2 f x y = star_of c" by auto
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   251
  then have "\<exists>a b. f a b = c" by transfer
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   252
  then obtain a b where "f a b = c" by auto
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   253
  then have "starfun2 f (star_of a) (star_of b) = star_of c" by transfer
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   254
  with c have "starfun2 f x y = starfun2 f (star_of a) (star_of b)" by simp
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   255
  then have "x = star_of a \<and> y = star_of b" by (rule inj')
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   256
  then show "x \<in> Standard \<and> y \<in> Standard" by (simp add: Standard_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   257
qed
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   258
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   259
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   260
subsection \<open>Internal predicates\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   261
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   262
definition unstar :: "bool star \<Rightarrow> bool"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   263
  where "unstar b \<longleftrightarrow> b = star_of True"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   264
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   265
lemma unstar_star_n: "unstar (star_n P) \<longleftrightarrow> eventually P \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   266
  by (simp add: unstar_def star_of_def star_n_eq_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   267
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   268
lemma unstar_star_of [simp]: "unstar (star_of p) = p"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   269
  by (simp add: unstar_def star_of_inject)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   270
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   271
text \<open>Transfer tactic should remove occurrences of \<^term>\<open>unstar\<close>.\<close>
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   272
setup \<open>Transfer_Principle.add_const \<^const_name>\<open>unstar\<close>\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   273
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   274
lemma transfer_unstar [transfer_intro]: "p \<equiv> star_n P \<Longrightarrow> unstar p \<equiv> eventually P \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   275
  by (simp only: unstar_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   276
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   277
definition starP :: "('a \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> bool"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   278
    (\<open>(\<open>open_block notation=\<open>prefix starP\<close>\<close>*p* _)\<close> [80] 80)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   279
  where "*p* P = (\<lambda>x. unstar (star_of P \<star> x))"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   280
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   281
definition starP2 :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> 'b star \<Rightarrow> bool"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   282
    (\<open>(\<open>open_block notation=\<open>prefix starP2\<close>\<close>*p2* _)\<close> [80] 80)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   283
  where "*p2* P = (\<lambda>x y. unstar (star_of P \<star> x \<star> y))"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   284
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   285
declare starP_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   286
declare starP2_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   287
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   288
lemma starP_star_n: "( *p* P) (star_n X) = eventually (\<lambda>n. P (X n)) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   289
  by (simp only: starP_def star_of_def Ifun_star_n unstar_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   290
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   291
lemma starP2_star_n: "( *p2* P) (star_n X) (star_n Y) = (eventually (\<lambda>n. P (X n) (Y n)) \<U>)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   292
  by (simp only: starP2_def star_of_def Ifun_star_n unstar_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   293
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   294
lemma starP_star_of [simp]: "( *p* P) (star_of x) = P x"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   295
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   296
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   297
lemma starP2_star_of [simp]: "( *p2* P) (star_of x) = *p* P x"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   298
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   299
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   300
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   301
subsection \<open>Internal sets\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   302
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   303
definition Iset :: "'a set star \<Rightarrow> 'a star set"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   304
  where "Iset A = {x. ( *p2* (\<in>)) x A}"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   305
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   306
lemma Iset_star_n: "(star_n X \<in> Iset (star_n A)) = (eventually (\<lambda>n. X n \<in> A n) \<U>)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   307
  by (simp add: Iset_def starP2_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   308
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   309
text \<open>Transfer tactic should remove occurrences of \<^term>\<open>Iset\<close>.\<close>
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   310
setup \<open>Transfer_Principle.add_const \<^const_name>\<open>Iset\<close>\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   311
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   312
lemma transfer_mem [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   313
  "x \<equiv> star_n X \<Longrightarrow> a \<equiv> Iset (star_n A) \<Longrightarrow> x \<in> a \<equiv> eventually (\<lambda>n. X n \<in> A n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   314
  by (simp only: Iset_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   315
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   316
lemma transfer_Collect [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   317
  "(\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   318
    Collect p \<equiv> Iset (star_n (\<lambda>n. Collect (P n)))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   319
  by (simp add: atomize_eq set_eq_iff all_star_eq Iset_star_n)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   320
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   321
lemma transfer_set_eq [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   322
  "a \<equiv> Iset (star_n A) \<Longrightarrow> b \<equiv> Iset (star_n B) \<Longrightarrow> a = b \<equiv> eventually (\<lambda>n. A n = B n) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   323
  by (simp only: set_eq_iff transfer_all transfer_iff transfer_mem)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   324
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   325
lemma transfer_ball [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   326
  "a \<equiv> Iset (star_n A) \<Longrightarrow> (\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   327
    \<forall>x\<in>a. p x \<equiv> eventually (\<lambda>n. \<forall>x\<in>A n. P n x) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   328
  by (simp only: Ball_def transfer_all transfer_imp transfer_mem)
27468
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 transfer_bex [transfer_intro]:
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   331
  "a \<equiv> Iset (star_n A) \<Longrightarrow> (\<And>X. p (star_n X) \<equiv> eventually (\<lambda>n. P n (X n)) \<U>) \<Longrightarrow>
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   332
    \<exists>x\<in>a. p x \<equiv> eventually (\<lambda>n. \<exists>x\<in>A n. P n x) \<U>"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   333
  by (simp only: Bex_def transfer_ex transfer_conj transfer_mem)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   334
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   335
lemma transfer_Iset [transfer_intro]: "a \<equiv> star_n A \<Longrightarrow> Iset a \<equiv> Iset (star_n (\<lambda>n. A n))"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   336
  by simp
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   337
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   338
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   339
text \<open>Nonstandard extensions of sets.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   340
81142
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   341
definition starset :: "'a set \<Rightarrow> 'a star set"
6ad2c917dd2e more inner-syntax markup;
wenzelm
parents: 79541
diff changeset
   342
    (\<open>(\<open>open_block notation=\<open>prefix starset\<close>\<close>*s* _)\<close> [80] 80)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   343
  where "starset A = Iset (star_of A)"
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   344
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   345
declare starset_def [transfer_unfold]
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   346
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   347
lemma starset_mem: "star_of x \<in> *s* A \<longleftrightarrow> x \<in> A"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   348
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   349
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   350
lemma starset_UNIV: "*s* (UNIV::'a set) = (UNIV::'a star set)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   351
  by (transfer UNIV_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   352
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   353
lemma starset_empty: "*s* {} = {}"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   354
  by (transfer empty_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   355
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   356
lemma starset_insert: "*s* (insert x A) = insert (star_of x) ( *s* A)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   357
  by (transfer insert_def Un_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   358
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   359
lemma starset_Un: "*s* (A \<union> B) = *s* A \<union> *s* B"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   360
  by (transfer Un_def) (rule refl)
27468
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 starset_Int: "*s* (A \<inter> B) = *s* A \<inter> *s* B"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   363
  by (transfer Int_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   364
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   365
lemma starset_Compl: "*s* -A = -( *s* A)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   366
  by (transfer Compl_eq) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   367
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   368
lemma starset_diff: "*s* (A - B) = *s* A - *s* B"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   369
  by (transfer set_diff_eq) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   370
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   371
lemma starset_image: "*s* (f ` A) = ( *f* f) ` ( *s* A)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   372
  by (transfer image_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   373
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   374
lemma starset_vimage: "*s* (f -` A) = ( *f* f) -` ( *s* A)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   375
  by (transfer vimage_def) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   376
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   377
lemma starset_subset: "( *s* A \<subseteq> *s* B) \<longleftrightarrow> A \<subseteq> B"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   378
  by (transfer subset_eq) (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   379
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   380
lemma starset_eq: "( *s* A = *s* B) \<longleftrightarrow> A = B"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   381
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   382
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   383
lemmas starset_simps [simp] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   384
  starset_mem     starset_UNIV
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   385
  starset_empty   starset_insert
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   386
  starset_Un      starset_Int
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   387
  starset_Compl   starset_diff
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   388
  starset_image   starset_vimage
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   389
  starset_subset  starset_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   390
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   391
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   392
subsection \<open>Syntactic classes\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   393
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   394
instantiation star :: (zero) zero
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   395
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   396
  definition star_zero_def: "0 \<equiv> star_of 0"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   397
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   398
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   399
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   400
instantiation star :: (one) one
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   401
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   402
  definition star_one_def: "1 \<equiv> star_of 1"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   403
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   404
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   405
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   406
instantiation star :: (plus) plus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   407
begin
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   408
  definition star_add_def: "(+) \<equiv> *f2* (+)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   409
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   410
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   411
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   412
instantiation star :: (times) times
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   413
begin
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 67635
diff changeset
   414
  definition star_mult_def: "((*)) \<equiv> *f2* ((*))"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   415
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   416
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   417
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   418
instantiation star :: (uminus) uminus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   419
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   420
  definition star_minus_def: "uminus \<equiv> *f* uminus"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   421
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   422
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   423
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   424
instantiation star :: (minus) minus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   425
begin
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   426
  definition star_diff_def: "(-) \<equiv> *f2* (-)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   427
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   428
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   429
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   430
instantiation star :: (abs) abs
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   431
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   432
  definition star_abs_def: "abs \<equiv> *f* abs"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   433
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   434
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   435
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   436
instantiation star :: (sgn) sgn
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   437
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   438
  definition star_sgn_def: "sgn \<equiv> *f* sgn"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   439
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   440
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   441
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   442
instantiation star :: (divide) divide
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   443
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   444
  definition star_divide_def:  "divide \<equiv> *f2* divide"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   445
  instance ..
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   446
end
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   447
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   448
instantiation star :: (inverse) inverse
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   449
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   450
  definition star_inverse_def: "inverse \<equiv> *f* inverse"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   451
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   452
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   453
35050
9f841f20dca6 renamed OrderedGroup to Groups; split theory Ring_and_Field into Rings Fields
haftmann
parents: 35043
diff changeset
   454
instance star :: (Rings.dvd) Rings.dvd ..
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27468
diff changeset
   455
63950
cdc1e59aa513 syntactic type class for operation mod named after mod;
haftmann
parents: 63456
diff changeset
   456
instantiation star :: (modulo) modulo
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   457
begin
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   458
  definition star_mod_def: "(mod) \<equiv> *f2* (mod)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   459
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   460
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   461
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   462
instantiation star :: (ord) ord
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   463
begin
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   464
  definition star_le_def: "(\<le>) \<equiv> *p2* (\<le>)"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   465
  definition star_less_def: "(<) \<equiv> *p2* (<)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   466
  instance ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   467
end
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
lemmas star_class_defs [transfer_unfold] =
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   470
  star_zero_def     star_one_def
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   471
  star_add_def      star_diff_def     star_minus_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   472
  star_mult_def     star_divide_def   star_inverse_def
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   473
  star_le_def       star_less_def     star_abs_def       star_sgn_def
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   474
  star_mod_def
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   475
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   476
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   477
text \<open>Class operations preserve standard elements.\<close>
27468
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
lemma Standard_zero: "0 \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   480
  by (simp add: star_zero_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   481
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   482
lemma Standard_one: "1 \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   483
  by (simp add: star_one_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   484
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   485
lemma Standard_add: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> x + y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   486
  by (simp add: star_add_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   487
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   488
lemma Standard_diff: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> x - y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   489
  by (simp add: star_diff_def)
27468
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
lemma Standard_minus: "x \<in> Standard \<Longrightarrow> - x \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   492
  by (simp add: star_minus_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   493
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   494
lemma Standard_mult: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> x * y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   495
  by (simp add: star_mult_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   496
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   497
lemma Standard_divide: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> x / y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   498
  by (simp add: star_divide_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   499
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   500
lemma Standard_inverse: "x \<in> Standard \<Longrightarrow> inverse x \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   501
  by (simp add: star_inverse_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   502
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61810
diff changeset
   503
lemma Standard_abs: "x \<in> Standard \<Longrightarrow> \<bar>x\<bar> \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   504
  by (simp add: star_abs_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   505
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   506
lemma Standard_mod: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> x mod y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   507
  by (simp add: star_mod_def)
27468
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
lemmas Standard_simps [simp] =
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   510
  Standard_zero  Standard_one
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   511
  Standard_add   Standard_diff    Standard_minus
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   512
  Standard_mult  Standard_divide  Standard_inverse
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   513
  Standard_abs   Standard_mod
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   514
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   515
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   516
text \<open>\<^term>\<open>star_of\<close> preserves class operations.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   517
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   518
lemma star_of_add: "star_of (x + y) = star_of x + star_of y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   519
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   520
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   521
lemma star_of_diff: "star_of (x - y) = star_of x - star_of y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   522
  by transfer (rule refl)
27468
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
lemma star_of_minus: "star_of (-x) = - star_of x"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   525
  by transfer (rule refl)
27468
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
lemma star_of_mult: "star_of (x * y) = star_of x * star_of y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   528
  by transfer (rule refl)
27468
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
lemma star_of_divide: "star_of (x / y) = star_of x / star_of y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   531
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   532
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   533
lemma star_of_inverse: "star_of (inverse x) = inverse (star_of x)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   534
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   535
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   536
lemma star_of_mod: "star_of (x mod y) = star_of x mod star_of y"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   537
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   538
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61810
diff changeset
   539
lemma star_of_abs: "star_of \<bar>x\<bar> = \<bar>star_of x\<bar>"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   540
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   541
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   542
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   543
text \<open>\<^term>\<open>star_of\<close> preserves numerals.\<close>
27468
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
lemma star_of_zero: "star_of 0 = 0"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   546
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   547
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   548
lemma star_of_one: "star_of 1 = 1"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   549
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   550
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   551
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69064
diff changeset
   552
text \<open>\<^term>\<open>star_of\<close> preserves orderings.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   553
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   554
lemma star_of_less: "(star_of x < star_of y) = (x < y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   555
by transfer (rule refl)
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
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
   558
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   559
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   560
lemma star_of_eq: "(star_of x = star_of y) = (x = y)"
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   561
by transfer (rule refl)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   562
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   563
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   564
text \<open>As above, for \<open>0\<close>.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   565
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   566
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
   567
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
   568
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
   569
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   570
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
   571
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
   572
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
   573
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   574
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   575
text \<open>As above, for \<open>1\<close>.\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   576
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   577
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
   578
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
   579
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
   580
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   581
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
   582
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
   583
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
   584
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   585
lemmas star_of_simps [simp] =
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   586
  star_of_add     star_of_diff    star_of_minus
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   587
  star_of_mult    star_of_divide  star_of_inverse
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 60041
diff changeset
   588
  star_of_mod     star_of_abs
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   589
  star_of_zero    star_of_one
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   590
  star_of_less    star_of_le      star_of_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   591
  star_of_0_less  star_of_0_le    star_of_0_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   592
  star_of_less_0  star_of_le_0    star_of_eq_0
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   593
  star_of_1_less  star_of_1_le    star_of_1_eq
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   594
  star_of_less_1  star_of_le_1    star_of_eq_1
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   595
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   596
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   597
subsection \<open>Ordering and lattice classes\<close>
27468
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
instance star :: (order) order
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   600
proof 
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   601
  show "\<And>x y::'a star. (x < y) = (x \<le> y \<and> \<not> y \<le> x)"
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   602
    by transfer (rule less_le_not_le)
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   603
  show "\<And>x::'a star. x \<le> x"
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   604
    by transfer (rule order_refl)
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   605
  show "\<And>x y z::'a star. \<lbrakk>x \<le> y; y \<le> z\<rbrakk> \<Longrightarrow> x \<le> z"
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   606
    by transfer (rule order_trans)
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   607
  show "\<And>x y::'a star. \<lbrakk>x \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> x = y"
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   608
    by transfer (rule order_antisym)
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   609
qed
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   610
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   611
instantiation star :: (semilattice_inf) semilattice_inf
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   612
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   613
  definition star_inf_def [transfer_unfold]: "inf \<equiv> *f2* inf"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   614
  instance by (standard; transfer) auto
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   615
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   616
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   617
instantiation star :: (semilattice_sup) semilattice_sup
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   618
begin
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   619
  definition star_sup_def [transfer_unfold]: "sup \<equiv> *f2* sup"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   620
  instance by (standard; transfer) auto
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   621
end
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   622
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   623
instance star :: (lattice) lattice ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   624
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   625
instance star :: (distrib_lattice) distrib_lattice
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60562
diff changeset
   626
  by (standard; transfer) (auto simp add: sup_inf_distrib1)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   627
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   628
lemma Standard_inf [simp]: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> inf x y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   629
  by (simp add: star_inf_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   630
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   631
lemma Standard_sup [simp]: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> sup x y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   632
  by (simp add: star_sup_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   633
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   634
lemma star_of_inf [simp]: "star_of (inf x y) = inf (star_of x) (star_of y)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   635
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   636
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   637
lemma star_of_sup [simp]: "star_of (sup x y) = sup (star_of x) (star_of y)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   638
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   639
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   640
instance star :: (linorder) linorder
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   641
  by (intro_classes, transfer, rule linorder_linear)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   642
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   643
lemma star_max_def [transfer_unfold]: "max = *f2* max"
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   644
  unfolding max_def
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   645
  by (intro ext, transfer, simp)
27468
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_min_def [transfer_unfold]: "min = *f2* min"
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   648
  unfolding min_def
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   649
  by (intro ext, transfer, simp)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   650
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   651
lemma Standard_max [simp]: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> max x y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   652
  by (simp add: star_max_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   653
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   654
lemma Standard_min [simp]: "x \<in> Standard \<Longrightarrow> y \<in> Standard \<Longrightarrow> min x y \<in> Standard"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   655
  by (simp add: star_min_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   656
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   657
lemma star_of_max [simp]: "star_of (max x y) = max (star_of x) (star_of y)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   658
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   659
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   660
lemma star_of_min [simp]: "star_of (min x y) = min (star_of x) (star_of y)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   661
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   662
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   663
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   664
subsection \<open>Ordered group classes\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   665
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   666
instance star :: (semigroup_add) semigroup_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   667
  by (intro_classes, transfer, rule add.assoc)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   668
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   669
instance star :: (ab_semigroup_add) ab_semigroup_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   670
  by (intro_classes, transfer, rule add.commute)
27468
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
instance star :: (semigroup_mult) semigroup_mult
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   673
  by (intro_classes, transfer, rule mult.assoc)
27468
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
instance star :: (ab_semigroup_mult) ab_semigroup_mult
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   676
  by (intro_classes, transfer, rule mult.commute)
27468
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
instance star :: (comm_monoid_add) comm_monoid_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   679
  by (intro_classes, transfer, rule comm_monoid_add_class.add_0)
27468
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
instance star :: (monoid_mult) monoid_mult
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   682
  apply intro_classes
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   683
   apply (transfer, rule mult_1_left)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   684
  apply (transfer, rule mult_1_right)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   685
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   686
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60562
diff changeset
   687
instance star :: (power) power ..
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60562
diff changeset
   688
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   689
instance star :: (comm_monoid_mult) comm_monoid_mult
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   690
  by (intro_classes, transfer, rule mult_1)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   691
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   692
instance star :: (cancel_semigroup_add) cancel_semigroup_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   693
  apply intro_classes
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   694
   apply (transfer, erule add_left_imp_eq)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   695
  apply (transfer, erule add_right_imp_eq)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   696
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   697
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   698
instance star :: (cancel_ab_semigroup_add) cancel_ab_semigroup_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   699
  by intro_classes (transfer, simp add: diff_diff_eq)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   700
29904
856f16a3b436 add class cancel_comm_monoid_add
huffman
parents: 29234
diff changeset
   701
instance star :: (cancel_comm_monoid_add) cancel_comm_monoid_add ..
856f16a3b436 add class cancel_comm_monoid_add
huffman
parents: 29234
diff changeset
   702
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   703
instance star :: (ab_group_add) ab_group_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   704
  apply intro_classes
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   705
   apply (transfer, rule left_minus)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   706
  apply (transfer, rule diff_conv_add_uminus)
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   707
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   708
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   709
instance star :: (ordered_ab_semigroup_add) ordered_ab_semigroup_add
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   710
  by (intro_classes, transfer, rule add_left_mono)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   711
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   712
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   713
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   714
instance star :: (ordered_ab_semigroup_add_imp_le) ordered_ab_semigroup_add_imp_le
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   715
  by (intro_classes, transfer, rule add_le_imp_le_left)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   716
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   717
instance star :: (ordered_comm_monoid_add) ordered_comm_monoid_add ..
63456
3365c8ec67bd sharing simp rules between ordered monoids and rings
fleury <Mathias.Fleury@mpi-inf.mpg.de>
parents: 62479
diff changeset
   718
instance star :: (ordered_ab_semigroup_monoid_add_imp_le) ordered_ab_semigroup_monoid_add_imp_le ..
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   719
instance star :: (ordered_cancel_comm_monoid_add) ordered_cancel_comm_monoid_add ..
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   720
instance star :: (ordered_ab_group_add) ordered_ab_group_add ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   721
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   722
instance star :: (ordered_ab_group_add_abs) ordered_ab_group_add_abs
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   723
  by intro_classes (transfer, simp add: abs_ge_self abs_leI abs_triangle_ineq)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   724
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   725
instance star :: (linordered_cancel_ab_semigroup_add) linordered_cancel_ab_semigroup_add ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   726
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   727
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   728
subsection \<open>Ring and field classes\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   729
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   730
instance star :: (semiring) semiring
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   731
  by (intro_classes; transfer) (fact distrib_right distrib_left)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   732
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   733
instance star :: (semiring_0) semiring_0
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   734
  by (intro_classes; transfer) simp_all
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   735
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   736
instance star :: (semiring_0_cancel) semiring_0_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   737
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   738
instance star :: (comm_semiring) comm_semiring
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   739
  by (intro_classes; transfer) (fact distrib_right)
27468
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
instance star :: (comm_semiring_0) comm_semiring_0 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   742
instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel ..
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
instance star :: (zero_neq_one) zero_neq_one
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   745
  by (intro_classes; transfer) (fact zero_neq_one)
27468
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 star :: (semiring_1) semiring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   748
instance star :: (comm_semiring_1) comm_semiring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   749
59680
034a4d15b52e make proofs work with 4762c690a75c
Andreas Lochbihler
parents: 59676
diff changeset
   750
declare dvd_def [transfer_refold]
59676
4762c690a75c more type class instances
Andreas Lochbihler
parents: 59557
diff changeset
   751
60562
24af00b010cf Amalgamation of the class comm_semiring_1_diff_distrib into comm_semiring_1_cancel. Moving axiom le_add_diff_inverse2 from semiring_numeral_div to linordered_semidom.
paulson <lp15@cam.ac.uk>
parents: 60516
diff changeset
   752
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   753
  by (intro_classes; transfer) (fact right_diff_distrib')
59676
4762c690a75c more type class instances
Andreas Lochbihler
parents: 59557
diff changeset
   754
59833
ab828c2c5d67 clarified no_zero_devisors: makes only sense in a semiring;
haftmann
parents: 59816
diff changeset
   755
instance star :: (semiring_no_zero_divisors) semiring_no_zero_divisors
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   756
  by (intro_classes; transfer) (fact no_zero_divisors)
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   757
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60562
diff changeset
   758
instance star :: (semiring_1_no_zero_divisors) semiring_1_no_zero_divisors ..
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   759
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   760
instance star :: (semiring_no_zero_divisors_cancel) semiring_no_zero_divisors_cancel
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   761
  by (intro_classes; transfer) simp_all
27468
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 :: (semiring_1_cancel) semiring_1_cancel ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   764
instance star :: (ring) ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   765
instance star :: (comm_ring) comm_ring ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   766
instance star :: (ring_1) ring_1 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   767
instance star :: (comm_ring_1) comm_ring_1 ..
59833
ab828c2c5d67 clarified no_zero_devisors: makes only sense in a semiring;
haftmann
parents: 59816
diff changeset
   768
instance star :: (semidom) semidom ..
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   769
60353
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
   770
instance star :: (semidom_divide) semidom_divide
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   771
  by (intro_classes; transfer) simp_all
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   772
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   773
instance star :: (ring_no_zero_divisors) ring_no_zero_divisors ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   774
instance star :: (ring_1_no_zero_divisors) ring_1_no_zero_divisors ..
62376
85f38d5f8807 Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents: 61975
diff changeset
   775
instance star :: (idom) idom ..
60353
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
   776
instance star :: (idom_divide) idom_divide ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   777
79541
4f40225936d1 common type class for trivial properties on div/mod
haftmann
parents: 70219
diff changeset
   778
instance star :: (divide_trivial) divide_trivial
4f40225936d1 common type class for trivial properties on div/mod
haftmann
parents: 70219
diff changeset
   779
  by (intro_classes; transfer) simp_all
4f40225936d1 common type class for trivial properties on div/mod
haftmann
parents: 70219
diff changeset
   780
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   781
instance star :: (division_ring) division_ring
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   782
  by (intro_classes; transfer) (simp_all add: divide_inverse)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   783
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   784
instance star :: (field) field
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   785
  by (intro_classes; transfer) (simp_all add: divide_inverse)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   786
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   787
instance star :: (ordered_semiring) ordered_semiring
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   788
  by (intro_classes; transfer) (fact mult_left_mono mult_right_mono)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   789
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   790
instance star :: (ordered_cancel_semiring) ordered_cancel_semiring ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   791
35043
07dbdf60d5ad dropped accidental duplication of "lin" prefix from cs. 108662d50512
haftmann
parents: 35035
diff changeset
   792
instance star :: (linordered_semiring_strict) linordered_semiring_strict
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   793
  by (intro_classes; transfer) (fact mult_strict_left_mono mult_strict_right_mono)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   794
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   795
instance star :: (ordered_comm_semiring) ordered_comm_semiring
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   796
  by (intro_classes; transfer) (fact mult_left_mono)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   797
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   798
instance star :: (ordered_cancel_comm_semiring) ordered_cancel_comm_semiring ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   799
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   800
instance star :: (linordered_comm_semiring_strict) linordered_comm_semiring_strict
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   801
  by (intro_classes; transfer) (fact mult_strict_left_mono)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   802
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   803
instance star :: (ordered_ring) ordered_ring ..
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   804
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   805
instance star :: (ordered_ring_abs) ordered_ring_abs
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   806
  by (intro_classes; transfer) (fact abs_eq_mult)
27468
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
instance star :: (abs_if) abs_if
60516
0826b7025d07 generalized some theorems about integral domains and moved to HOL theories
haftmann
parents: 60429
diff changeset
   809
  by (intro_classes; transfer) (fact abs_if)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   810
35043
07dbdf60d5ad dropped accidental duplication of "lin" prefix from cs. 108662d50512
haftmann
parents: 35035
diff changeset
   811
instance star :: (linordered_ring_strict) linordered_ring_strict ..
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   812
instance star :: (ordered_comm_ring) ordered_comm_ring ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   813
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   814
instance star :: (linordered_semidom) linordered_semidom
64290
fb5c74a58796 suitable logical type class for abs, sgn
haftmann
parents: 64270
diff changeset
   815
  by (intro_classes; transfer) (fact zero_less_one le_add_diff_inverse2)+
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   816
64290
fb5c74a58796 suitable logical type class for abs, sgn
haftmann
parents: 64270
diff changeset
   817
instance star :: (linordered_idom) linordered_idom
fb5c74a58796 suitable logical type class for abs, sgn
haftmann
parents: 64270
diff changeset
   818
  by (intro_classes; transfer) (fact sgn_if)
fb5c74a58796 suitable logical type class for abs, sgn
haftmann
parents: 64270
diff changeset
   819
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 31021
diff changeset
   820
instance star :: (linordered_field) linordered_field ..
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   821
66806
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   822
instance star :: (algebraic_semidom) algebraic_semidom ..
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   823
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   824
instantiation star :: (normalization_semidom) normalization_semidom
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   825
begin
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   826
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   827
definition unit_factor_star :: "'a star \<Rightarrow> 'a star"
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   828
  where [transfer_unfold]: "unit_factor_star = *f* unit_factor"
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   829
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   830
definition normalize_star :: "'a star \<Rightarrow> 'a star"
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   831
  where [transfer_unfold]: "normalize_star = *f* normalize"
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   832
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   833
instance
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   834
  by standard (transfer; simp add: is_unit_unit_factor unit_factor_mult)+
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   835
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   836
end
a4e82b58d833 abolished (semi)ring_div in favour of euclidean_(semi)ring_cancel
haftmann
parents: 64600
diff changeset
   837
66815
93c6632ddf44 one uniform type class for parity structures
haftmann
parents: 66806
diff changeset
   838
instance star :: (semidom_modulo) semidom_modulo
93c6632ddf44 one uniform type class for parity structures
haftmann
parents: 66806
diff changeset
   839
  by standard (transfer; simp)
93c6632ddf44 one uniform type class for parity structures
haftmann
parents: 66806
diff changeset
   840
93c6632ddf44 one uniform type class for parity structures
haftmann
parents: 66806
diff changeset
   841
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   842
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   843
subsection \<open>Power\<close>
30968
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   844
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66815
diff changeset
   845
lemma star_power_def [transfer_unfold]: "(^) \<equiv> \<lambda>x n. ( *f* (\<lambda>x. x ^ n)) x"
30968
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   846
proof (rule eq_reflection, rule ext, rule ext)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   847
  show "x ^ n = ( *f* (\<lambda>x. x ^ n)) x" for n :: nat and x :: "'a star"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   848
  proof (induct n arbitrary: x)
30968
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   849
    case 0
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   850
    have "\<And>x::'a star. ( *f* (\<lambda>x. 1)) x = 1"
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   851
      by transfer simp
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   852
    then show ?case by simp
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   853
  next
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   854
    case (Suc n)
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60867
diff changeset
   855
    have "\<And>x::'a star. x * ( *f* (\<lambda>x::'a. x ^ n)) x = ( *f* (\<lambda>x::'a. x * x ^ n)) x"
30968
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   856
      by transfer simp
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   857
    with Suc show ?case by simp
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   858
  qed
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   859
qed
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   860
30968
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   861
lemma Standard_power [simp]: "x \<in> Standard \<Longrightarrow> x ^ n \<in> Standard"
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   862
  by (simp add: star_power_def)
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   863
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   864
lemma star_of_power [simp]: "star_of (x ^ n) = star_of x ^ n"
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   865
  by transfer (rule refl)
10fef94f40fc adaptions due to rearrangment of power operation
haftmann
parents: 30729
diff changeset
   866
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   867
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   868
subsection \<open>Number classes\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   869
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   870
instance star :: (numeral) numeral ..
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   871
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   872
lemma star_numeral_def [transfer_unfold]: "numeral k = star_of (numeral k)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   873
  by (induct k) (simp_all only: numeral.simps star_of_one star_of_add)
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   874
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   875
lemma Standard_numeral [simp]: "numeral k \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   876
  by (simp add: star_numeral_def)
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   877
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   878
lemma star_of_numeral [simp]: "star_of (numeral k) = numeral k"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   879
  by transfer (rule refl)
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   880
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   881
lemma star_of_nat_def [transfer_unfold]: "of_nat n = star_of (of_nat n)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   882
  by (induct n) simp_all
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   883
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   884
lemmas star_of_compare_numeral [simp] =
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   885
  star_of_less [of "numeral k", simplified star_of_numeral]
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   886
  star_of_le   [of "numeral k", simplified star_of_numeral]
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   887
  star_of_eq   [of "numeral k", simplified star_of_numeral]
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   888
  star_of_less [of _ "numeral k", simplified star_of_numeral]
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   889
  star_of_le   [of _ "numeral k", simplified star_of_numeral]
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   890
  star_of_eq   [of _ "numeral k", simplified star_of_numeral]
54489
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   891
  star_of_less [of "- numeral k", simplified star_of_numeral]
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   892
  star_of_le   [of "- numeral k", simplified star_of_numeral]
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   893
  star_of_eq   [of "- numeral k", simplified star_of_numeral]
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   894
  star_of_less [of _ "- numeral k", simplified star_of_numeral]
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   895
  star_of_le   [of _ "- numeral k", simplified star_of_numeral]
03ff4d1e6784 eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents: 54230
diff changeset
   896
  star_of_eq   [of _ "- numeral k", simplified star_of_numeral] for k
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46008
diff changeset
   897
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   898
lemma Standard_of_nat [simp]: "of_nat n \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   899
  by (simp add: star_of_nat_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   900
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   901
lemma star_of_of_nat [simp]: "star_of (of_nat n) = of_nat n"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   902
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   903
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   904
lemma star_of_int_def [transfer_unfold]: "of_int z = star_of (of_int z)"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   905
  by (rule int_diff_cases [of z]) simp
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   906
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   907
lemma Standard_of_int [simp]: "of_int z \<in> Standard"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   908
  by (simp add: star_of_int_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   909
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   910
lemma star_of_of_int [simp]: "star_of (of_int z) = of_int z"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   911
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   912
62378
85ed00c1fe7c generalize more theorems to support enat and ennreal
hoelzl
parents: 62376
diff changeset
   913
instance star :: (semiring_char_0) semiring_char_0
85ed00c1fe7c generalize more theorems to support enat and ennreal
hoelzl
parents: 62376
diff changeset
   914
proof
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   915
  have "inj (star_of :: 'a \<Rightarrow> 'a star)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   916
    by (rule injI) simp
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   917
  then have "inj (star_of \<circ> of_nat :: nat \<Rightarrow> 'a star)"
69700
7a92cbec7030 new material about summations and powers, along with some tweaks
paulson <lp15@cam.ac.uk>
parents: 69605
diff changeset
   918
    using inj_of_nat by (rule inj_compose)
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   919
  then show "inj (of_nat :: nat \<Rightarrow> 'a star)"
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   920
    by (simp add: comp_def)
38621
d6cb7e625d75 more concise characterization of of_nat operation and class semiring_char_0
haftmann
parents: 37765
diff changeset
   921
qed
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   922
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   923
instance star :: (ring_char_0) ring_char_0 ..
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   924
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   925
61975
b4b11391c676 isabelle update_cartouches -c -t;
wenzelm
parents: 61945
diff changeset
   926
subsection \<open>Finite class\<close>
27468
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
lemma starset_finite: "finite A \<Longrightarrow> *s* A = star_of ` A"
64435
c93b0e6131c3 misc tuning and modernization;
wenzelm
parents: 64290
diff changeset
   929
  by (erule finite_induct) simp_all
27468
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 :: (finite) finite
70219
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   932
proof intro_classes
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   933
  show "finite (UNIV::'a star set)"
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   934
    by (metis starset_UNIV finite finite_imageI starset_finite)
b21efbf64292 yet more de-applying
paulson <lp15@cam.ac.uk>
parents: 69700
diff changeset
   935
qed
27468
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
end