src/HOL/Hyperreal/StarClasses.thy
author wenzelm
Tue, 03 Jul 2007 20:26:08 +0200
changeset 23551 84f0996a530b
parent 23282 dfc459989d24
child 23879 4776af8be741
permissions -rw-r--r--
rename class dom to ring_1_no_zero_divisors (cf. HOL/Ring_and_Field.thy 1.84 by huffman);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     1
(*  Title       : HOL/Hyperreal/StarClasses.thy
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     2
    ID          : $Id$
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     3
    Author      : Brian Huffman
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     4
*)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     5
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     6
header {* Class Instances *}
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     7
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
     8
theory StarClasses
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
     9
imports StarDef
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
    10
begin
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
    11
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    12
subsection {* Syntactic classes *}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    13
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    14
instance star :: (zero) zero
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    15
  star_zero_def:    "0 \<equiv> star_of 0" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    16
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    17
instance star :: (one) one
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    18
  star_one_def:     "1 \<equiv> star_of 1" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    19
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    20
instance star :: (plus) plus
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    21
  star_add_def:     "(op +) \<equiv> *f2* (op +)" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    22
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    23
instance star :: (times) times
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    24
  star_mult_def:    "(op *) \<equiv> *f2* (op *)" ..
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    25
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    26
instance star :: (minus) minus
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
    27
  star_minus_def:   "uminus \<equiv> *f* uminus"
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    28
  star_diff_def:    "(op -) \<equiv> *f2* (op -)"
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    29
  star_abs_def:     "abs \<equiv> *f* abs" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    30
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    31
instance star :: (inverse) inverse
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
    32
  star_divide_def:  "(op /) \<equiv> *f2* (op /)"
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    33
  star_inverse_def: "inverse \<equiv> *f* inverse" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    34
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    35
instance star :: (number) number
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    36
  star_number_def:  "number_of b \<equiv> star_of (number_of b)" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    37
22993
haftmann
parents: 22992
diff changeset
    38
instance star :: (Divides.div) Divides.div
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
    39
  star_div_def:     "(op div) \<equiv> *f2* (op div)"
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    40
  star_mod_def:     "(op mod) \<equiv> *f2* (op mod)" ..
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    41
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    42
instance star :: (power) power
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
    43
  star_power_def:   "(op ^) \<equiv> \<lambda>x n. ( *f* (\<lambda>x. x ^ n)) x" ..
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    44
22452
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
    45
instance star :: (ord) ord
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
    46
  star_le_def:      "(op \<le>) \<equiv> *p2* (op \<le>)"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
    47
  star_less_def:    "(op <) \<equiv> *p2* (op <)" ..
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
    48
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    49
lemmas star_class_defs [transfer_unfold] =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    50
  star_zero_def     star_one_def      star_number_def
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    51
  star_add_def      star_diff_def     star_minus_def
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    52
  star_mult_def     star_divide_def   star_inverse_def
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    53
  star_le_def       star_less_def     star_abs_def
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    54
  star_div_def      star_mod_def      star_power_def
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
    55
20719
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    56
text {* Class operations preserve standard elements *}
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    57
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    58
lemma Standard_zero: "0 \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    59
by (simp add: star_zero_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    60
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    61
lemma Standard_one: "1 \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    62
by (simp add: star_one_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    63
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    64
lemma Standard_number_of: "number_of b \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    65
by (simp add: star_number_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    66
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    67
lemma Standard_add: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x + y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    68
by (simp add: star_add_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    69
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    70
lemma Standard_diff: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x - y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    71
by (simp add: star_diff_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    72
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    73
lemma Standard_minus: "x \<in> Standard \<Longrightarrow> - x \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    74
by (simp add: star_minus_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    75
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    76
lemma Standard_mult: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x * y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    77
by (simp add: star_mult_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    78
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    79
lemma Standard_divide: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x / y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    80
by (simp add: star_divide_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    81
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    82
lemma Standard_inverse: "x \<in> Standard \<Longrightarrow> inverse x \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    83
by (simp add: star_inverse_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    84
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    85
lemma Standard_abs: "x \<in> Standard \<Longrightarrow> abs x \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    86
by (simp add: star_abs_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    87
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    88
lemma Standard_div: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x div y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    89
by (simp add: star_div_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    90
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    91
lemma Standard_mod: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x mod y \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    92
by (simp add: star_mod_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    93
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    94
lemma Standard_power: "x \<in> Standard \<Longrightarrow> x ^ n \<in> Standard"
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    95
by (simp add: star_power_def)
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    96
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    97
lemmas Standard_simps [simp] =
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    98
  Standard_zero  Standard_one  Standard_number_of
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
    99
  Standard_add  Standard_diff  Standard_minus
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
   100
  Standard_mult  Standard_divide  Standard_inverse
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
   101
  Standard_abs  Standard_div  Standard_mod
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
   102
  Standard_power
bf00c5935432 define new constant Standard = range star_of
huffman
parents: 20633
diff changeset
   103
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   104
text {* @{term star_of} preserves class operations *}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   105
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   106
lemma star_of_add: "star_of (x + y) = star_of x + star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   107
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   108
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   109
lemma star_of_diff: "star_of (x - y) = star_of x - star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   110
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   111
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   112
lemma star_of_minus: "star_of (-x) = - star_of x"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   113
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   114
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   115
lemma star_of_mult: "star_of (x * y) = star_of x * star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   116
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   117
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   118
lemma star_of_divide: "star_of (x / y) = star_of x / star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   119
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   120
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   121
lemma star_of_inverse: "star_of (inverse x) = inverse (star_of x)"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   122
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   123
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   124
lemma star_of_div: "star_of (x div y) = star_of x div star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   125
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   126
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   127
lemma star_of_mod: "star_of (x mod y) = star_of x mod star_of y"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   128
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   129
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   130
lemma star_of_power: "star_of (x ^ n) = star_of x ^ n"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   131
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   132
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   133
lemma star_of_abs: "star_of (abs x) = abs (star_of x)"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   134
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   135
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   136
text {* @{term star_of} preserves numerals *}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   137
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   138
lemma star_of_zero: "star_of 0 = 0"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   139
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   140
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   141
lemma star_of_one: "star_of 1 = 1"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   142
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   143
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   144
lemma star_of_number_of: "star_of (number_of x) = number_of x"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   145
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   146
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   147
text {* @{term star_of} preserves orderings *}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   148
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   149
lemma star_of_less: "(star_of x < star_of y) = (x < y)"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   150
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   151
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   152
lemma star_of_le: "(star_of x \<le> star_of y) = (x \<le> y)"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   153
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   154
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   155
lemma star_of_eq: "(star_of x = star_of y) = (x = y)"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   156
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   157
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   158
text{*As above, for 0*}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   159
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   160
lemmas star_of_0_less = star_of_less [of 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   161
lemmas star_of_0_le   = star_of_le   [of 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   162
lemmas star_of_0_eq   = star_of_eq   [of 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   163
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   164
lemmas star_of_less_0 = star_of_less [of _ 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   165
lemmas star_of_le_0   = star_of_le   [of _ 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   166
lemmas star_of_eq_0   = star_of_eq   [of _ 0, simplified star_of_zero]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   167
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   168
text{*As above, for 1*}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   169
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   170
lemmas star_of_1_less = star_of_less [of 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   171
lemmas star_of_1_le   = star_of_le   [of 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   172
lemmas star_of_1_eq   = star_of_eq   [of 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   173
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   174
lemmas star_of_less_1 = star_of_less [of _ 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   175
lemmas star_of_le_1   = star_of_le   [of _ 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   176
lemmas star_of_eq_1   = star_of_eq   [of _ 1, simplified star_of_one]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   177
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   178
text{*As above, for numerals*}
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   179
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   180
lemmas star_of_number_less =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   181
  star_of_less [of "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   182
lemmas star_of_number_le   =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   183
  star_of_le   [of "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   184
lemmas star_of_number_eq   =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   185
  star_of_eq   [of "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   186
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   187
lemmas star_of_less_number =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   188
  star_of_less [of _ "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   189
lemmas star_of_le_number   =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   190
  star_of_le   [of _ "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   191
lemmas star_of_eq_number   =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   192
  star_of_eq   [of _ "number_of w", standard, simplified star_of_number_of]
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   193
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   194
lemmas star_of_simps [simp] =
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   195
  star_of_add     star_of_diff    star_of_minus
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   196
  star_of_mult    star_of_divide  star_of_inverse
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   197
  star_of_div     star_of_mod
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   198
  star_of_power   star_of_abs
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   199
  star_of_zero    star_of_one     star_of_number_of
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   200
  star_of_less    star_of_le      star_of_eq
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   201
  star_of_0_less  star_of_0_le    star_of_0_eq
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   202
  star_of_less_0  star_of_le_0    star_of_eq_0
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   203
  star_of_1_less  star_of_1_le    star_of_1_eq
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   204
  star_of_less_1  star_of_le_1    star_of_eq_1
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   205
  star_of_number_less star_of_number_le star_of_number_eq
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   206
  star_of_less_number star_of_le_number star_of_eq_number
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   207
22452
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   208
subsection {* Ordering and lattice classes *}
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   209
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   210
instance star :: (order) order
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   211
apply (intro_classes)
22316
f662831459de added class "preorder"
haftmann
parents: 21199
diff changeset
   212
apply (transfer, rule order_less_le)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   213
apply (transfer, rule order_refl)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   214
apply (transfer, erule (1) order_trans)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   215
apply (transfer, erule (1) order_antisym)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   216
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   217
22452
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   218
instance star :: (lower_semilattice) lower_semilattice
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   219
  star_inf_def [transfer_unfold]: "inf \<equiv> *f2* inf"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   220
  by default (transfer star_inf_def, auto)+
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   221
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   222
instance star :: (upper_semilattice) upper_semilattice
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   223
  star_sup_def [transfer_unfold]: "sup \<equiv> *f2* sup"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   224
  by default (transfer star_sup_def, auto)+
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   225
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   226
instance star :: (lattice) lattice ..
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   227
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   228
instance star :: (distrib_lattice) distrib_lattice
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   229
  by default (transfer, auto simp add: sup_inf_distrib1)
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   230
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   231
lemma Standard_inf [simp]:
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   232
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> inf x y \<in> Standard"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   233
by (simp add: star_inf_def)
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   234
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   235
lemma Standard_sup [simp]:
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   236
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> sup x y \<in> Standard"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   237
by (simp add: star_sup_def)
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   238
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   239
lemma star_of_inf [simp]: "star_of (inf x y) = inf (star_of x) (star_of y)"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   240
by transfer (rule refl)
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   241
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   242
lemma star_of_sup [simp]: "star_of (sup x y) = sup (star_of x) (star_of y)"
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   243
by transfer (rule refl)
8a86fd2a1bf0 adjusted to new lattice theory developement in Lattices.thy / FixedPoint.thy
haftmann
parents: 22422
diff changeset
   244
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   245
instance star :: (linorder) linorder
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   246
by (intro_classes, transfer, rule linorder_linear)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   247
20720
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   248
lemma star_max_def [transfer_unfold]: "max = *f2* max"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   249
apply (rule ext, rule ext)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   250
apply (unfold max_def, transfer, fold max_def)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   251
apply (rule refl)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   252
done
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   253
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   254
lemma star_min_def [transfer_unfold]: "min = *f2* min"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   255
apply (rule ext, rule ext)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   256
apply (unfold min_def, transfer, fold min_def)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   257
apply (rule refl)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   258
done
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   259
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   260
lemma Standard_max [simp]:
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   261
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> max x y \<in> Standard"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   262
by (simp add: star_max_def)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   263
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   264
lemma Standard_min [simp]:
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   265
  "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> min x y \<in> Standard"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   266
by (simp add: star_min_def)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   267
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   268
lemma star_of_max [simp]: "star_of (max x y) = max (star_of x) (star_of y)"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   269
by transfer (rule refl)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   270
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   271
lemma star_of_min [simp]: "star_of (min x y) = min (star_of x) (star_of y)"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   272
by transfer (rule refl)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   273
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   274
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   275
subsection {* Ordered group classes *}
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   276
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   277
instance star :: (semigroup_add) semigroup_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   278
by (intro_classes, transfer, rule add_assoc)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   279
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   280
instance star :: (ab_semigroup_add) ab_semigroup_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   281
by (intro_classes, transfer, rule add_commute)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   282
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   283
instance star :: (semigroup_mult) semigroup_mult
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   284
by (intro_classes, transfer, rule mult_assoc)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   285
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   286
instance star :: (ab_semigroup_mult) ab_semigroup_mult
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   287
by (intro_classes, transfer, rule mult_commute)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   288
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   289
instance star :: (comm_monoid_add) comm_monoid_add
22384
33a46e6c7f04 prefix of class interpretation not mandatory any longer
haftmann
parents: 22316
diff changeset
   290
by (intro_classes, transfer, rule comm_monoid_add_class.zero_plus.add_0)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   291
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   292
instance star :: (monoid_mult) monoid_mult
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   293
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   294
apply (transfer, rule mult_1_left)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   295
apply (transfer, rule mult_1_right)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   296
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   297
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   298
instance star :: (comm_monoid_mult) comm_monoid_mult
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   299
by (intro_classes, transfer, rule mult_1)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   300
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   301
instance star :: (cancel_semigroup_add) cancel_semigroup_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   302
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   303
apply (transfer, erule add_left_imp_eq)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   304
apply (transfer, erule add_right_imp_eq)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   305
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   306
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   307
instance star :: (cancel_ab_semigroup_add) cancel_ab_semigroup_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   308
by (intro_classes, transfer, rule add_imp_eq)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   309
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   310
instance star :: (ab_group_add) ab_group_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   311
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   312
apply (transfer, rule left_minus)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   313
apply (transfer, rule diff_minus)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   314
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   315
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   316
instance star :: (pordered_ab_semigroup_add) pordered_ab_semigroup_add
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   317
by (intro_classes, transfer, rule add_left_mono)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   318
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   319
instance star :: (pordered_cancel_ab_semigroup_add) pordered_cancel_ab_semigroup_add ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   320
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   321
instance star :: (pordered_ab_semigroup_add_imp_le) pordered_ab_semigroup_add_imp_le
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   322
by (intro_classes, transfer, rule add_le_imp_le_left)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   323
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   324
instance star :: (pordered_ab_group_add) pordered_ab_group_add ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   325
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   326
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   327
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   328
instance star :: (lordered_ab_group) lordered_ab_group ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   329
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   330
instance star :: (lordered_ab_group_abs) lordered_ab_group_abs
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   331
by (intro_classes, transfer, rule abs_lattice)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   332
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   333
subsection {* Ring and field classes *}
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   334
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   335
instance star :: (semiring) semiring
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   336
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   337
apply (transfer, rule left_distrib)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   338
apply (transfer, rule right_distrib)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   339
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   340
21199
2d83f93c3580 * Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
krauss
parents: 20720
diff changeset
   341
instance star :: (semiring_0) semiring_0 
2d83f93c3580 * Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
krauss
parents: 20720
diff changeset
   342
by intro_classes (transfer, simp)+
2d83f93c3580 * Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
krauss
parents: 20720
diff changeset
   343
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   344
instance star :: (semiring_0_cancel) semiring_0_cancel ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   345
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   346
instance star :: (comm_semiring) comm_semiring
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   347
by (intro_classes, transfer, rule distrib)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   348
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   349
instance star :: (comm_semiring_0) comm_semiring_0 ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   350
instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   351
20633
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20553
diff changeset
   352
instance star :: (zero_neq_one) zero_neq_one
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   353
by (intro_classes, transfer, rule zero_neq_one)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   354
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   355
instance star :: (semiring_1) semiring_1 ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   356
instance star :: (comm_semiring_1) comm_semiring_1 ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   357
20633
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20553
diff changeset
   358
instance star :: (no_zero_divisors) no_zero_divisors
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   359
by (intro_classes, transfer, rule no_zero_divisors)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   360
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   361
instance star :: (semiring_1_cancel) semiring_1_cancel ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   362
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   363
instance star :: (ring) ring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   364
instance star :: (comm_ring) comm_ring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   365
instance star :: (ring_1) ring_1 ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   366
instance star :: (comm_ring_1) comm_ring_1 ..
22992
fc54d5fc4a7a add classes ring_no_zero_divisors and dom
huffman
parents: 22911
diff changeset
   367
instance star :: (ring_no_zero_divisors) ring_no_zero_divisors ..
23551
84f0996a530b rename class dom to ring_1_no_zero_divisors (cf. HOL/Ring_and_Field.thy 1.84 by huffman);
wenzelm
parents: 23282
diff changeset
   368
instance star :: (ring_1_no_zero_divisors) ring_1_no_zero_divisors ..
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   369
instance star :: (idom) idom .. 
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   370
20540
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   371
instance star :: (division_ring) division_ring
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   372
apply (intro_classes)
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   373
apply (transfer, erule left_inverse)
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   374
apply (transfer, erule right_inverse)
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   375
done
588ba06ba867 add instance for class division_ring
huffman
parents: 17429
diff changeset
   376
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   377
instance star :: (field) field
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   378
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   379
apply (transfer, erule left_inverse)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   380
apply (transfer, rule divide_inverse)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   381
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   382
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   383
instance star :: (division_by_zero) division_by_zero
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   384
by (intro_classes, transfer, rule inverse_zero)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   385
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   386
instance star :: (pordered_semiring) pordered_semiring
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   387
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   388
apply (transfer, erule (1) mult_left_mono)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   389
apply (transfer, erule (1) mult_right_mono)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   390
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   391
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   392
instance star :: (pordered_cancel_semiring) pordered_cancel_semiring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   393
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   394
instance star :: (ordered_semiring_strict) ordered_semiring_strict
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   395
apply (intro_classes)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   396
apply (transfer, erule (1) mult_strict_left_mono)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   397
apply (transfer, erule (1) mult_strict_right_mono)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   398
done
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   399
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   400
instance star :: (pordered_comm_semiring) pordered_comm_semiring
22384
33a46e6c7f04 prefix of class interpretation not mandatory any longer
haftmann
parents: 22316
diff changeset
   401
by (intro_classes, transfer, rule mult_mono1_class.times_zero_less_eq_less.mult_mono)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   402
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   403
instance star :: (pordered_cancel_comm_semiring) pordered_cancel_comm_semiring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   404
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   405
instance star :: (ordered_comm_semiring_strict) ordered_comm_semiring_strict
22518
21c221e1c8eb naming tuned
haftmann
parents: 22452
diff changeset
   406
by (intro_classes, transfer, rule ordered_comm_semiring_strict_class.plus_less_eq_less_zero_times.mult_strict_mono)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   407
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   408
instance star :: (pordered_ring) pordered_ring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   409
instance star :: (lordered_ring) lordered_ring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   410
20633
e98f59806244 renamed axclass_xxxx axclasses;
wenzelm
parents: 20553
diff changeset
   411
instance star :: (abs_if) abs_if
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   412
by (intro_classes, transfer, rule abs_if)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   413
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   414
instance star :: (ordered_ring_strict) ordered_ring_strict ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   415
instance star :: (pordered_comm_ring) pordered_comm_ring ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   416
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   417
instance star :: (ordered_semidom) ordered_semidom
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   418
by (intro_classes, transfer, rule zero_less_one)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   419
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   420
instance star :: (ordered_idom) ordered_idom ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   421
instance star :: (ordered_field) ordered_field ..
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   422
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   423
subsection {* Power classes *}
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   424
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   425
text {*
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   426
  Proving the class axiom @{thm [source] power_Suc} for type
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   427
  @{typ "'a star"} is a little tricky, because it quantifies
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   428
  over values of type @{typ nat}. The transfer principle does
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   429
  not handle quantification over non-star types in general,
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   430
  but we can work around this by fixing an arbitrary @{typ nat}
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   431
  value, and then applying the transfer principle.
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   432
*}
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   433
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   434
instance star :: (recpower) recpower
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   435
proof
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   436
  show "\<And>a::'a star. a ^ 0 = 1"
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   437
    by transfer (rule power_0)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   438
next
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   439
  fix n show "\<And>a::'a star. a ^ Suc n = a * a ^ n"
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   440
    by transfer (rule power_Suc)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   441
qed
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   442
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   443
subsection {* Number classes *}
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   444
20720
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   445
lemma star_of_nat_def [transfer_unfold]: "of_nat n = star_of (of_nat n)"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   446
by (induct_tac n, simp_all)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   447
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   448
lemma Standard_of_nat [simp]: "of_nat n \<in> Standard"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   449
by (simp add: star_of_nat_def)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   450
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   451
lemma star_of_of_nat [simp]: "star_of (of_nat n) = of_nat n"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   452
by transfer (rule refl)
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   453
20720
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   454
lemma star_of_int_def [transfer_unfold]: "of_int z = star_of (of_int z)"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   455
by (rule_tac z=z in int_diff_cases, simp)
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   456
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   457
lemma Standard_of_int [simp]: "of_int z \<in> Standard"
4358cd94a449 more lemmas about Standard and star_of
huffman
parents: 20719
diff changeset
   458
by (simp add: star_of_int_def)
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   459
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   460
lemma star_of_of_int [simp]: "star_of (of_int z) = of_int z"
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17296
diff changeset
   461
by transfer (rule refl)
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   462
23282
dfc459989d24 add axclass semiring_char_0 for types where of_nat is injective
huffman
parents: 22993
diff changeset
   463
instance star :: (semiring_char_0) semiring_char_0
dfc459989d24 add axclass semiring_char_0 for types where of_nat is injective
huffman
parents: 22993
diff changeset
   464
by (intro_classes, simp only: star_of_nat_def star_of_eq of_nat_eq_iff)
dfc459989d24 add axclass semiring_char_0 for types where of_nat is injective
huffman
parents: 22993
diff changeset
   465
dfc459989d24 add axclass semiring_char_0 for types where of_nat is injective
huffman
parents: 22993
diff changeset
   466
instance star :: (ring_char_0) ring_char_0 ..
22911
2f5e8d70a179 new axclass ring_char_0 for rings with characteristic 0, used for of_int_eq_iff and related lemmas
huffman
parents: 22518
diff changeset
   467
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   468
instance star :: (number_ring) number_ring
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   469
by (intro_classes, simp only: star_number_def star_of_int_def number_of_eq)
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   470
17429
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   471
subsection {* Finite class *}
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   472
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   473
lemma starset_finite: "finite A \<Longrightarrow> *s* A = star_of ` A"
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   474
by (erule finite_induct, simp_all)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   475
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   476
instance star :: (finite) finite
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   477
apply (intro_classes)
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   478
apply (subst starset_UNIV [symmetric])
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   479
apply (subst starset_finite [OF finite])
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   480
apply (rule finite_imageI [OF finite])
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   481
done
e8d6ed3aacfe merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents: 17332
diff changeset
   482
17296
d0e0905d548e class instances for nonstandard types
huffman
parents:
diff changeset
   483
end