| author | krauss | 
| Wed, 18 Oct 2006 16:13:03 +0200 | |
| changeset 21051 | c49467a9c1e1 | 
| parent 20720 | 4358cd94a449 | 
| child 21199 | 2d83f93c3580 | 
| 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  | 
||
| 20720 | 214  | 
lemma star_max_def [transfer_unfold]: "max = *f2* max"  | 
215  | 
apply (rule ext, rule ext)  | 
|
216  | 
apply (unfold max_def, transfer, fold max_def)  | 
|
217  | 
apply (rule refl)  | 
|
218  | 
done  | 
|
219  | 
||
220  | 
lemma star_min_def [transfer_unfold]: "min = *f2* min"  | 
|
221  | 
apply (rule ext, rule ext)  | 
|
222  | 
apply (unfold min_def, transfer, fold min_def)  | 
|
223  | 
apply (rule refl)  | 
|
224  | 
done  | 
|
225  | 
||
226  | 
lemma Standard_max [simp]:  | 
|
227  | 
"\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> max x y \<in> Standard"  | 
|
228  | 
by (simp add: star_max_def)  | 
|
229  | 
||
230  | 
lemma Standard_min [simp]:  | 
|
231  | 
"\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> min x y \<in> Standard"  | 
|
232  | 
by (simp add: star_min_def)  | 
|
233  | 
||
234  | 
lemma star_of_max [simp]: "star_of (max x y) = max (star_of x) (star_of y)"  | 
|
235  | 
by transfer (rule refl)  | 
|
236  | 
||
237  | 
lemma star_of_min [simp]: "star_of (min x y) = min (star_of x) (star_of y)"  | 
|
238  | 
by transfer (rule refl)  | 
|
239  | 
||
| 
17332
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
240  | 
subsection {* Lattice ordering classes *}
 | 
| 17296 | 241  | 
|
242  | 
text {*
 | 
|
243  | 
Some extra trouble is necessary because the class axioms  | 
|
244  | 
  for @{term meet} and @{term join} use quantification over
 | 
|
245  | 
function spaces.  | 
|
246  | 
*}  | 
|
247  | 
||
248  | 
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
 | 
249  | 
  "\<exists>f::('a \<Rightarrow> 'b) star. P (\<lambda>x. f \<star> x)
 | 
| 17296 | 250  | 
\<Longrightarrow> \<exists>f::'a star \<Rightarrow> 'b star. P f"  | 
251  | 
by (erule exE, erule exI)  | 
|
252  | 
||
253  | 
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
 | 
254  | 
  "\<exists>f::('a \<Rightarrow> 'b \<Rightarrow> 'c) star. P (\<lambda>x y. f \<star> x \<star> y)
 | 
| 17296 | 255  | 
\<Longrightarrow> \<exists>f::'a star \<Rightarrow> 'b star \<Rightarrow> 'c star. P f"  | 
256  | 
by (erule exE, erule exI)  | 
|
257  | 
||
258  | 
instance star :: (join_semilorder) join_semilorder  | 
|
259  | 
apply (intro_classes)  | 
|
260  | 
apply (rule ex_star_fun2)  | 
|
261  | 
apply (transfer is_join_def)  | 
|
262  | 
apply (rule join_exists)  | 
|
263  | 
done  | 
|
264  | 
||
265  | 
instance star :: (meet_semilorder) meet_semilorder  | 
|
266  | 
apply (intro_classes)  | 
|
267  | 
apply (rule ex_star_fun2)  | 
|
268  | 
apply (transfer is_meet_def)  | 
|
269  | 
apply (rule meet_exists)  | 
|
270  | 
done  | 
|
271  | 
||
272  | 
instance star :: (lorder) lorder ..  | 
|
273  | 
||
| 20720 | 274  | 
lemma star_meet_def [transfer_unfold]: "meet = *f2* meet"  | 
275  | 
apply (rule is_meet_unique [OF is_meet_meet])  | 
|
276  | 
apply (transfer is_meet_def, rule is_meet_meet)  | 
|
277  | 
done  | 
|
278  | 
||
279  | 
lemma star_join_def [transfer_unfold]: "join = *f2* join"  | 
|
280  | 
apply (rule is_join_unique [OF is_join_join])  | 
|
281  | 
apply (transfer is_join_def, rule is_join_join)  | 
|
| 17296 | 282  | 
done  | 
283  | 
||
| 20720 | 284  | 
lemma Standard_meet [simp]:  | 
285  | 
"\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> meet x y \<in> Standard"  | 
|
286  | 
by (simp add: star_meet_def)  | 
|
287  | 
||
288  | 
lemma Standard_join [simp]:  | 
|
289  | 
"\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> join x y \<in> Standard"  | 
|
290  | 
by (simp add: star_join_def)  | 
|
291  | 
||
292  | 
lemma star_of_meet [simp]: "star_of (meet x y) = meet (star_of x) (star_of y)"  | 
|
293  | 
by transfer (rule refl)  | 
|
294  | 
||
295  | 
lemma star_of_join [simp]: "star_of (join x y) = join (star_of x) (star_of y)"  | 
|
296  | 
by transfer (rule refl)  | 
|
| 17296 | 297  | 
|
| 
17332
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
298  | 
subsection {* Ordered group classes *}
 | 
| 17296 | 299  | 
|
300  | 
instance star :: (semigroup_add) semigroup_add  | 
|
301  | 
by (intro_classes, transfer, rule add_assoc)  | 
|
302  | 
||
303  | 
instance star :: (ab_semigroup_add) ab_semigroup_add  | 
|
304  | 
by (intro_classes, transfer, rule add_commute)  | 
|
305  | 
||
306  | 
instance star :: (semigroup_mult) semigroup_mult  | 
|
307  | 
by (intro_classes, transfer, rule mult_assoc)  | 
|
308  | 
||
309  | 
instance star :: (ab_semigroup_mult) ab_semigroup_mult  | 
|
310  | 
by (intro_classes, transfer, rule mult_commute)  | 
|
311  | 
||
312  | 
instance star :: (comm_monoid_add) comm_monoid_add  | 
|
313  | 
by (intro_classes, transfer, rule comm_monoid_add_class.add_0)  | 
|
314  | 
||
315  | 
instance star :: (monoid_mult) monoid_mult  | 
|
316  | 
apply (intro_classes)  | 
|
317  | 
apply (transfer, rule mult_1_left)  | 
|
318  | 
apply (transfer, rule mult_1_right)  | 
|
319  | 
done  | 
|
320  | 
||
321  | 
instance star :: (comm_monoid_mult) comm_monoid_mult  | 
|
322  | 
by (intro_classes, transfer, rule mult_1)  | 
|
323  | 
||
324  | 
instance star :: (cancel_semigroup_add) cancel_semigroup_add  | 
|
325  | 
apply (intro_classes)  | 
|
326  | 
apply (transfer, erule add_left_imp_eq)  | 
|
327  | 
apply (transfer, erule add_right_imp_eq)  | 
|
328  | 
done  | 
|
329  | 
||
330  | 
instance star :: (cancel_ab_semigroup_add) cancel_ab_semigroup_add  | 
|
331  | 
by (intro_classes, transfer, rule add_imp_eq)  | 
|
332  | 
||
333  | 
instance star :: (ab_group_add) ab_group_add  | 
|
334  | 
apply (intro_classes)  | 
|
335  | 
apply (transfer, rule left_minus)  | 
|
336  | 
apply (transfer, rule diff_minus)  | 
|
337  | 
done  | 
|
338  | 
||
339  | 
instance star :: (pordered_ab_semigroup_add) pordered_ab_semigroup_add  | 
|
340  | 
by (intro_classes, transfer, rule add_left_mono)  | 
|
341  | 
||
342  | 
instance star :: (pordered_cancel_ab_semigroup_add) pordered_cancel_ab_semigroup_add ..  | 
|
343  | 
||
344  | 
instance star :: (pordered_ab_semigroup_add_imp_le) pordered_ab_semigroup_add_imp_le  | 
|
345  | 
by (intro_classes, transfer, rule add_le_imp_le_left)  | 
|
346  | 
||
347  | 
instance star :: (pordered_ab_group_add) pordered_ab_group_add ..  | 
|
348  | 
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..  | 
|
349  | 
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet ..  | 
|
350  | 
instance star :: (lordered_ab_group_meet) lordered_ab_group_meet ..  | 
|
351  | 
instance star :: (lordered_ab_group) lordered_ab_group ..  | 
|
352  | 
||
353  | 
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
 | 
354  | 
by (intro_classes, transfer, rule abs_lattice)  | 
| 17296 | 355  | 
|
| 
17429
 
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
 
huffman 
parents: 
17332 
diff
changeset
 | 
356  | 
subsection {* Ring and field classes *}
 | 
| 17296 | 357  | 
|
358  | 
instance star :: (semiring) semiring  | 
|
359  | 
apply (intro_classes)  | 
|
360  | 
apply (transfer, rule left_distrib)  | 
|
361  | 
apply (transfer, rule right_distrib)  | 
|
362  | 
done  | 
|
363  | 
||
364  | 
instance star :: (semiring_0) semiring_0 ..  | 
|
365  | 
instance star :: (semiring_0_cancel) semiring_0_cancel ..  | 
|
366  | 
||
367  | 
instance star :: (comm_semiring) comm_semiring  | 
|
368  | 
by (intro_classes, transfer, rule distrib)  | 
|
369  | 
||
370  | 
instance star :: (comm_semiring_0) comm_semiring_0 ..  | 
|
371  | 
instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel ..  | 
|
372  | 
||
| 20633 | 373  | 
instance star :: (zero_neq_one) zero_neq_one  | 
| 17296 | 374  | 
by (intro_classes, transfer, rule zero_neq_one)  | 
375  | 
||
376  | 
instance star :: (semiring_1) semiring_1 ..  | 
|
377  | 
instance star :: (comm_semiring_1) comm_semiring_1 ..  | 
|
378  | 
||
| 20633 | 379  | 
instance star :: (no_zero_divisors) no_zero_divisors  | 
| 17296 | 380  | 
by (intro_classes, transfer, rule no_zero_divisors)  | 
381  | 
||
382  | 
instance star :: (semiring_1_cancel) semiring_1_cancel ..  | 
|
383  | 
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel ..  | 
|
384  | 
instance star :: (ring) ring ..  | 
|
385  | 
instance star :: (comm_ring) comm_ring ..  | 
|
386  | 
instance star :: (ring_1) ring_1 ..  | 
|
387  | 
instance star :: (comm_ring_1) comm_ring_1 ..  | 
|
388  | 
instance star :: (idom) idom ..  | 
|
389  | 
||
| 20540 | 390  | 
instance star :: (division_ring) division_ring  | 
391  | 
apply (intro_classes)  | 
|
392  | 
apply (transfer, erule left_inverse)  | 
|
393  | 
apply (transfer, erule right_inverse)  | 
|
394  | 
done  | 
|
395  | 
||
| 17296 | 396  | 
instance star :: (field) field  | 
397  | 
apply (intro_classes)  | 
|
398  | 
apply (transfer, erule left_inverse)  | 
|
399  | 
apply (transfer, rule divide_inverse)  | 
|
400  | 
done  | 
|
401  | 
||
402  | 
instance star :: (division_by_zero) division_by_zero  | 
|
403  | 
by (intro_classes, transfer, rule inverse_zero)  | 
|
404  | 
||
405  | 
instance star :: (pordered_semiring) pordered_semiring  | 
|
406  | 
apply (intro_classes)  | 
|
407  | 
apply (transfer, erule (1) mult_left_mono)  | 
|
408  | 
apply (transfer, erule (1) mult_right_mono)  | 
|
409  | 
done  | 
|
410  | 
||
411  | 
instance star :: (pordered_cancel_semiring) pordered_cancel_semiring ..  | 
|
412  | 
||
413  | 
instance star :: (ordered_semiring_strict) ordered_semiring_strict  | 
|
414  | 
apply (intro_classes)  | 
|
415  | 
apply (transfer, erule (1) mult_strict_left_mono)  | 
|
416  | 
apply (transfer, erule (1) mult_strict_right_mono)  | 
|
417  | 
done  | 
|
418  | 
||
419  | 
instance star :: (pordered_comm_semiring) pordered_comm_semiring  | 
|
420  | 
by (intro_classes, transfer, rule pordered_comm_semiring_class.mult_mono)  | 
|
421  | 
||
422  | 
instance star :: (pordered_cancel_comm_semiring) pordered_cancel_comm_semiring ..  | 
|
423  | 
||
424  | 
instance star :: (ordered_comm_semiring_strict) ordered_comm_semiring_strict  | 
|
425  | 
by (intro_classes, transfer, rule ordered_comm_semiring_strict_class.mult_strict_mono)  | 
|
426  | 
||
427  | 
instance star :: (pordered_ring) pordered_ring ..  | 
|
428  | 
instance star :: (lordered_ring) lordered_ring ..  | 
|
429  | 
||
| 20633 | 430  | 
instance star :: (abs_if) abs_if  | 
| 17296 | 431  | 
by (intro_classes, transfer, rule abs_if)  | 
432  | 
||
433  | 
instance star :: (ordered_ring_strict) ordered_ring_strict ..  | 
|
434  | 
instance star :: (pordered_comm_ring) pordered_comm_ring ..  | 
|
435  | 
||
436  | 
instance star :: (ordered_semidom) ordered_semidom  | 
|
437  | 
by (intro_classes, transfer, rule zero_less_one)  | 
|
438  | 
||
439  | 
instance star :: (ordered_idom) ordered_idom ..  | 
|
440  | 
instance star :: (ordered_field) ordered_field ..  | 
|
441  | 
||
| 
17332
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
442  | 
subsection {* Power classes *}
 | 
| 17296 | 443  | 
|
444  | 
text {*
 | 
|
445  | 
  Proving the class axiom @{thm [source] power_Suc} for type
 | 
|
446  | 
  @{typ "'a star"} is a little tricky, because it quantifies
 | 
|
447  | 
  over values of type @{typ nat}. The transfer principle does
 | 
|
448  | 
not handle quantification over non-star types in general,  | 
|
449  | 
  but we can work around this by fixing an arbitrary @{typ nat}
 | 
|
450  | 
value, and then applying the transfer principle.  | 
|
451  | 
*}  | 
|
452  | 
||
453  | 
instance star :: (recpower) recpower  | 
|
454  | 
proof  | 
|
455  | 
show "\<And>a::'a star. a ^ 0 = 1"  | 
|
456  | 
by transfer (rule power_0)  | 
|
457  | 
next  | 
|
458  | 
fix n show "\<And>a::'a star. a ^ Suc n = a * a ^ n"  | 
|
459  | 
by transfer (rule power_Suc)  | 
|
460  | 
qed  | 
|
461  | 
||
| 
17332
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
462  | 
subsection {* Number classes *}
 | 
| 17296 | 463  | 
|
| 20720 | 464  | 
lemma star_of_nat_def [transfer_unfold]: "of_nat n = star_of (of_nat n)"  | 
465  | 
by (induct_tac n, simp_all)  | 
|
466  | 
||
467  | 
lemma Standard_of_nat [simp]: "of_nat n \<in> Standard"  | 
|
468  | 
by (simp add: star_of_nat_def)  | 
|
| 17296 | 469  | 
|
| 
17332
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
470  | 
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
 | 
471  | 
by transfer (rule refl)  | 
| 
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
472  | 
|
| 20720 | 473  | 
lemma star_of_int_def [transfer_unfold]: "of_int z = star_of (of_int z)"  | 
474  | 
by (rule_tac z=z in int_diff_cases, simp)  | 
|
475  | 
||
476  | 
lemma Standard_of_int [simp]: "of_int z \<in> Standard"  | 
|
477  | 
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
 | 
478  | 
|
| 
 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 
huffman 
parents: 
17296 
diff
changeset
 | 
479  | 
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
 | 
480  | 
by transfer (rule refl)  | 
| 17296 | 481  | 
|
482  | 
instance star :: (number_ring) number_ring  | 
|
483  | 
by (intro_classes, simp only: star_number_def star_of_int_def number_of_eq)  | 
|
484  | 
||
| 
17429
 
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
 
huffman 
parents: 
17332 
diff
changeset
 | 
485  | 
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
 | 
486  | 
|
| 
 
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
 
huffman 
parents: 
17332 
diff
changeset
 | 
487  | 
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
 | 
488  | 
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
 | 
489  | 
|
| 
 
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
 
huffman 
parents: 
17332 
diff
changeset
 | 
490  | 
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
 | 
491  | 
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
 | 
492  | 
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
 | 
493  | 
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
 | 
494  | 
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
 | 
495  | 
done  | 
| 
 
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
 
huffman 
parents: 
17332 
diff
changeset
 | 
496  | 
|
| 17296 | 497  | 
end  |