author | huffman |
Wed, 27 Sep 2006 00:54:10 +0200 | |
changeset 20719 | bf00c5935432 |
parent 20633 | e98f59806244 |
child 20720 | 4358cd94a449 |
permissions | -rw-r--r-- |
17296 | 1 |
(* Title : HOL/Hyperreal/StarClasses.thy |
2 |
ID : $Id$ |
|
3 |
Author : Brian Huffman |
|
4 |
*) |
|
5 |
||
6 |
header {* Class Instances *} |
|
7 |
||
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 | 10 |
begin |
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 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
14 |
instance star :: (ord) ord .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
15 |
instance star :: (zero) zero .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
16 |
instance star :: (one) one .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
17 |
instance star :: (plus) plus .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
18 |
instance star :: (times) times .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
19 |
instance star :: (minus) minus .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
20 |
instance star :: (inverse) inverse .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
21 |
instance star :: (number) number .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
22 |
instance star :: ("Divides.div") "Divides.div" .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
23 |
instance star :: (power) power .. |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
24 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
25 |
defs (overloaded) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
26 |
star_zero_def: "0 \<equiv> star_of 0" |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
27 |
star_one_def: "1 \<equiv> star_of 1" |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
28 |
star_number_def: "number_of b \<equiv> star_of (number_of b)" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
29 |
star_add_def: "(op +) \<equiv> *f2* (op +)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
30 |
star_diff_def: "(op -) \<equiv> *f2* (op -)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
31 |
star_minus_def: "uminus \<equiv> *f* uminus" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
32 |
star_mult_def: "(op *) \<equiv> *f2* (op *)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
33 |
star_divide_def: "(op /) \<equiv> *f2* (op /)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
34 |
star_inverse_def: "inverse \<equiv> *f* inverse" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
35 |
star_le_def: "(op \<le>) \<equiv> *p2* (op \<le>)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
36 |
star_less_def: "(op <) \<equiv> *p2* (op <)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
37 |
star_abs_def: "abs \<equiv> *f* abs" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
38 |
star_div_def: "(op div) \<equiv> *f2* (op div)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
39 |
star_mod_def: "(op mod) \<equiv> *f2* (op mod)" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
40 |
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
|
41 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
42 |
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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
|
20719 | 49 |
text {* Class operations preserve standard elements *} |
50 |
||
51 |
lemma Standard_zero: "0 \<in> Standard" |
|
52 |
by (simp add: star_zero_def) |
|
53 |
||
54 |
lemma Standard_one: "1 \<in> Standard" |
|
55 |
by (simp add: star_one_def) |
|
56 |
||
57 |
lemma Standard_number_of: "number_of b \<in> Standard" |
|
58 |
by (simp add: star_number_def) |
|
59 |
||
60 |
lemma Standard_add: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x + y \<in> Standard" |
|
61 |
by (simp add: star_add_def) |
|
62 |
||
63 |
lemma Standard_diff: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x - y \<in> Standard" |
|
64 |
by (simp add: star_diff_def) |
|
65 |
||
66 |
lemma Standard_minus: "x \<in> Standard \<Longrightarrow> - x \<in> Standard" |
|
67 |
by (simp add: star_minus_def) |
|
68 |
||
69 |
lemma Standard_mult: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x * y \<in> Standard" |
|
70 |
by (simp add: star_mult_def) |
|
71 |
||
72 |
lemma Standard_divide: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x / y \<in> Standard" |
|
73 |
by (simp add: star_divide_def) |
|
74 |
||
75 |
lemma Standard_inverse: "x \<in> Standard \<Longrightarrow> inverse x \<in> Standard" |
|
76 |
by (simp add: star_inverse_def) |
|
77 |
||
78 |
lemma Standard_abs: "x \<in> Standard \<Longrightarrow> abs x \<in> Standard" |
|
79 |
by (simp add: star_abs_def) |
|
80 |
||
81 |
lemma Standard_div: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x div y \<in> Standard" |
|
82 |
by (simp add: star_div_def) |
|
83 |
||
84 |
lemma Standard_mod: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x mod y \<in> Standard" |
|
85 |
by (simp add: star_mod_def) |
|
86 |
||
87 |
lemma Standard_power: "x \<in> Standard \<Longrightarrow> x ^ n \<in> Standard" |
|
88 |
by (simp add: star_power_def) |
|
89 |
||
90 |
lemmas Standard_simps [simp] = |
|
91 |
Standard_zero Standard_one Standard_number_of |
|
92 |
Standard_add Standard_diff Standard_minus |
|
93 |
Standard_mult Standard_divide Standard_inverse |
|
94 |
Standard_abs Standard_div Standard_mod |
|
95 |
Standard_power |
|
96 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
97 |
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
|
98 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
99 |
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
|
100 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
101 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
102 |
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
|
103 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
104 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
105 |
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
|
106 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
107 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
108 |
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
|
109 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
110 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
111 |
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
|
112 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
113 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
114 |
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
|
115 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
116 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
117 |
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
|
118 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
119 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
120 |
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
|
121 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
122 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
123 |
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
|
124 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
125 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
126 |
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
|
127 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
128 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
129 |
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
|
130 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
131 |
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
|
132 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
133 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
134 |
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
|
135 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
136 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
137 |
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
|
138 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
139 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
140 |
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
|
141 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
142 |
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
|
143 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
144 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
145 |
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
|
146 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
147 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
148 |
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
|
149 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
150 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
151 |
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
|
152 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
153 |
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
|
154 |
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
|
155 |
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
|
156 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
157 |
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
|
158 |
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
|
159 |
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
|
160 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
161 |
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
|
162 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
163 |
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
|
164 |
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
|
165 |
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
|
166 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
167 |
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
|
168 |
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
|
169 |
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
|
170 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
171 |
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
|
172 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
173 |
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
|
174 |
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
|
175 |
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
|
176 |
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
|
177 |
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
|
178 |
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
|
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_less_number = |
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_le_number = |
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_eq_number = |
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_simps [simp] = |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
188 |
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
|
189 |
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
|
190 |
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
|
191 |
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
|
192 |
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
|
193 |
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
|
194 |
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
|
195 |
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
|
196 |
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
|
197 |
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
|
198 |
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
|
199 |
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
|
200 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
201 |
subsection {* Ordering classes *} |
17296 | 202 |
|
203 |
instance star :: (order) order |
|
204 |
apply (intro_classes) |
|
205 |
apply (transfer, rule order_refl) |
|
206 |
apply (transfer, erule (1) order_trans) |
|
207 |
apply (transfer, erule (1) order_antisym) |
|
208 |
apply (transfer, rule order_less_le) |
|
209 |
done |
|
210 |
||
211 |
instance star :: (linorder) linorder |
|
212 |
by (intro_classes, transfer, rule linorder_linear) |
|
213 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
214 |
subsection {* Lattice ordering classes *} |
17296 | 215 |
|
216 |
text {* |
|
217 |
Some extra trouble is necessary because the class axioms |
|
218 |
for @{term meet} and @{term join} use quantification over |
|
219 |
function spaces. |
|
220 |
*} |
|
221 |
||
222 |
lemma ex_star_fun: |
|
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
223 |
"\<exists>f::('a \<Rightarrow> 'b) star. P (\<lambda>x. f \<star> x) |
17296 | 224 |
\<Longrightarrow> \<exists>f::'a star \<Rightarrow> 'b star. P f" |
225 |
by (erule exE, erule exI) |
|
226 |
||
227 |
lemma ex_star_fun2: |
|
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
228 |
"\<exists>f::('a \<Rightarrow> 'b \<Rightarrow> 'c) star. P (\<lambda>x y. f \<star> x \<star> y) |
17296 | 229 |
\<Longrightarrow> \<exists>f::'a star \<Rightarrow> 'b star \<Rightarrow> 'c star. P f" |
230 |
by (erule exE, erule exI) |
|
231 |
||
232 |
instance star :: (join_semilorder) join_semilorder |
|
233 |
apply (intro_classes) |
|
234 |
apply (rule ex_star_fun2) |
|
235 |
apply (transfer is_join_def) |
|
236 |
apply (rule join_exists) |
|
237 |
done |
|
238 |
||
239 |
instance star :: (meet_semilorder) meet_semilorder |
|
240 |
apply (intro_classes) |
|
241 |
apply (rule ex_star_fun2) |
|
242 |
apply (transfer is_meet_def) |
|
243 |
apply (rule meet_exists) |
|
244 |
done |
|
245 |
||
246 |
instance star :: (lorder) lorder .. |
|
247 |
||
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
248 |
lemma star_join_def [transfer_unfold]: "join \<equiv> *f2* join" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
249 |
apply (rule is_join_unique [OF is_join_join, THEN eq_reflection]) |
17296 | 250 |
apply (transfer is_join_def, rule is_join_join) |
251 |
done |
|
252 |
||
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
253 |
lemma star_meet_def [transfer_unfold]: "meet \<equiv> *f2* meet" |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
254 |
apply (rule is_meet_unique [OF is_meet_meet, THEN eq_reflection]) |
17296 | 255 |
apply (transfer is_meet_def, rule is_meet_meet) |
256 |
done |
|
257 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
258 |
subsection {* Ordered group classes *} |
17296 | 259 |
|
260 |
instance star :: (semigroup_add) semigroup_add |
|
261 |
by (intro_classes, transfer, rule add_assoc) |
|
262 |
||
263 |
instance star :: (ab_semigroup_add) ab_semigroup_add |
|
264 |
by (intro_classes, transfer, rule add_commute) |
|
265 |
||
266 |
instance star :: (semigroup_mult) semigroup_mult |
|
267 |
by (intro_classes, transfer, rule mult_assoc) |
|
268 |
||
269 |
instance star :: (ab_semigroup_mult) ab_semigroup_mult |
|
270 |
by (intro_classes, transfer, rule mult_commute) |
|
271 |
||
272 |
instance star :: (comm_monoid_add) comm_monoid_add |
|
273 |
by (intro_classes, transfer, rule comm_monoid_add_class.add_0) |
|
274 |
||
275 |
instance star :: (monoid_mult) monoid_mult |
|
276 |
apply (intro_classes) |
|
277 |
apply (transfer, rule mult_1_left) |
|
278 |
apply (transfer, rule mult_1_right) |
|
279 |
done |
|
280 |
||
281 |
instance star :: (comm_monoid_mult) comm_monoid_mult |
|
282 |
by (intro_classes, transfer, rule mult_1) |
|
283 |
||
284 |
instance star :: (cancel_semigroup_add) cancel_semigroup_add |
|
285 |
apply (intro_classes) |
|
286 |
apply (transfer, erule add_left_imp_eq) |
|
287 |
apply (transfer, erule add_right_imp_eq) |
|
288 |
done |
|
289 |
||
290 |
instance star :: (cancel_ab_semigroup_add) cancel_ab_semigroup_add |
|
291 |
by (intro_classes, transfer, rule add_imp_eq) |
|
292 |
||
293 |
instance star :: (ab_group_add) ab_group_add |
|
294 |
apply (intro_classes) |
|
295 |
apply (transfer, rule left_minus) |
|
296 |
apply (transfer, rule diff_minus) |
|
297 |
done |
|
298 |
||
299 |
instance star :: (pordered_ab_semigroup_add) pordered_ab_semigroup_add |
|
300 |
by (intro_classes, transfer, rule add_left_mono) |
|
301 |
||
302 |
instance star :: (pordered_cancel_ab_semigroup_add) pordered_cancel_ab_semigroup_add .. |
|
303 |
||
304 |
instance star :: (pordered_ab_semigroup_add_imp_le) pordered_ab_semigroup_add_imp_le |
|
305 |
by (intro_classes, transfer, rule add_le_imp_le_left) |
|
306 |
||
307 |
instance star :: (pordered_ab_group_add) pordered_ab_group_add .. |
|
308 |
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add .. |
|
309 |
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet .. |
|
310 |
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet .. |
|
311 |
instance star :: (lordered_ab_group) lordered_ab_group .. |
|
312 |
||
313 |
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
|
314 |
by (intro_classes, transfer, rule abs_lattice) |
17296 | 315 |
|
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
316 |
subsection {* Ring and field classes *} |
17296 | 317 |
|
318 |
instance star :: (semiring) semiring |
|
319 |
apply (intro_classes) |
|
320 |
apply (transfer, rule left_distrib) |
|
321 |
apply (transfer, rule right_distrib) |
|
322 |
done |
|
323 |
||
324 |
instance star :: (semiring_0) semiring_0 .. |
|
325 |
instance star :: (semiring_0_cancel) semiring_0_cancel .. |
|
326 |
||
327 |
instance star :: (comm_semiring) comm_semiring |
|
328 |
by (intro_classes, transfer, rule distrib) |
|
329 |
||
330 |
instance star :: (comm_semiring_0) comm_semiring_0 .. |
|
331 |
instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel .. |
|
332 |
||
20633 | 333 |
instance star :: (zero_neq_one) zero_neq_one |
17296 | 334 |
by (intro_classes, transfer, rule zero_neq_one) |
335 |
||
336 |
instance star :: (semiring_1) semiring_1 .. |
|
337 |
instance star :: (comm_semiring_1) comm_semiring_1 .. |
|
338 |
||
20633 | 339 |
instance star :: (no_zero_divisors) no_zero_divisors |
17296 | 340 |
by (intro_classes, transfer, rule no_zero_divisors) |
341 |
||
342 |
instance star :: (semiring_1_cancel) semiring_1_cancel .. |
|
343 |
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel .. |
|
344 |
instance star :: (ring) ring .. |
|
345 |
instance star :: (comm_ring) comm_ring .. |
|
346 |
instance star :: (ring_1) ring_1 .. |
|
347 |
instance star :: (comm_ring_1) comm_ring_1 .. |
|
348 |
instance star :: (idom) idom .. |
|
349 |
||
20540 | 350 |
instance star :: (division_ring) division_ring |
351 |
apply (intro_classes) |
|
352 |
apply (transfer, erule left_inverse) |
|
353 |
apply (transfer, erule right_inverse) |
|
354 |
done |
|
355 |
||
17296 | 356 |
instance star :: (field) field |
357 |
apply (intro_classes) |
|
358 |
apply (transfer, erule left_inverse) |
|
359 |
apply (transfer, rule divide_inverse) |
|
360 |
done |
|
361 |
||
362 |
instance star :: (division_by_zero) division_by_zero |
|
363 |
by (intro_classes, transfer, rule inverse_zero) |
|
364 |
||
365 |
instance star :: (pordered_semiring) pordered_semiring |
|
366 |
apply (intro_classes) |
|
367 |
apply (transfer, erule (1) mult_left_mono) |
|
368 |
apply (transfer, erule (1) mult_right_mono) |
|
369 |
done |
|
370 |
||
371 |
instance star :: (pordered_cancel_semiring) pordered_cancel_semiring .. |
|
372 |
||
373 |
instance star :: (ordered_semiring_strict) ordered_semiring_strict |
|
374 |
apply (intro_classes) |
|
375 |
apply (transfer, erule (1) mult_strict_left_mono) |
|
376 |
apply (transfer, erule (1) mult_strict_right_mono) |
|
377 |
done |
|
378 |
||
379 |
instance star :: (pordered_comm_semiring) pordered_comm_semiring |
|
380 |
by (intro_classes, transfer, rule pordered_comm_semiring_class.mult_mono) |
|
381 |
||
382 |
instance star :: (pordered_cancel_comm_semiring) pordered_cancel_comm_semiring .. |
|
383 |
||
384 |
instance star :: (ordered_comm_semiring_strict) ordered_comm_semiring_strict |
|
385 |
by (intro_classes, transfer, rule ordered_comm_semiring_strict_class.mult_strict_mono) |
|
386 |
||
387 |
instance star :: (pordered_ring) pordered_ring .. |
|
388 |
instance star :: (lordered_ring) lordered_ring .. |
|
389 |
||
20633 | 390 |
instance star :: (abs_if) abs_if |
17296 | 391 |
by (intro_classes, transfer, rule abs_if) |
392 |
||
393 |
instance star :: (ordered_ring_strict) ordered_ring_strict .. |
|
394 |
instance star :: (pordered_comm_ring) pordered_comm_ring .. |
|
395 |
||
396 |
instance star :: (ordered_semidom) ordered_semidom |
|
397 |
by (intro_classes, transfer, rule zero_less_one) |
|
398 |
||
399 |
instance star :: (ordered_idom) ordered_idom .. |
|
400 |
instance star :: (ordered_field) ordered_field .. |
|
401 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
402 |
subsection {* Power classes *} |
17296 | 403 |
|
404 |
text {* |
|
405 |
Proving the class axiom @{thm [source] power_Suc} for type |
|
406 |
@{typ "'a star"} is a little tricky, because it quantifies |
|
407 |
over values of type @{typ nat}. The transfer principle does |
|
408 |
not handle quantification over non-star types in general, |
|
409 |
but we can work around this by fixing an arbitrary @{typ nat} |
|
410 |
value, and then applying the transfer principle. |
|
411 |
*} |
|
412 |
||
413 |
instance star :: (recpower) recpower |
|
414 |
proof |
|
415 |
show "\<And>a::'a star. a ^ 0 = 1" |
|
416 |
by transfer (rule power_0) |
|
417 |
next |
|
418 |
fix n show "\<And>a::'a star. a ^ Suc n = a * a ^ n" |
|
419 |
by transfer (rule power_Suc) |
|
420 |
qed |
|
421 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
422 |
subsection {* Number classes *} |
17296 | 423 |
|
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
424 |
lemma star_of_nat_def [transfer_unfold]: "of_nat n \<equiv> star_of (of_nat n)" |
17296 | 425 |
by (rule eq_reflection, induct_tac n, simp_all) |
426 |
||
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
427 |
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
|
428 |
by transfer (rule refl) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
429 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
430 |
lemma star_of_int_def [transfer_unfold]: "of_int z \<equiv> star_of (of_int z)" |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
431 |
by (rule eq_reflection, rule_tac z=z in int_diff_cases, simp) |
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
432 |
|
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17296
diff
changeset
|
433 |
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
|
434 |
by transfer (rule refl) |
17296 | 435 |
|
436 |
instance star :: (number_ring) number_ring |
|
437 |
by (intro_classes, simp only: star_number_def star_of_int_def number_of_eq) |
|
438 |
||
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
439 |
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
|
440 |
|
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
441 |
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
|
442 |
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
|
443 |
|
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
444 |
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
|
445 |
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
|
446 |
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
|
447 |
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
|
448 |
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
|
449 |
done |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
450 |
|
17296 | 451 |
end |