60 |
60 |
61 |
61 |
62 text \<open>Additive structures\<close> |
62 text \<open>Additive structures\<close> |
63 |
63 |
64 instance "fun" :: (type, semigroup_add) semigroup_add |
64 instance "fun" :: (type, semigroup_add) semigroup_add |
65 by default (simp add: fun_eq_iff add.assoc) |
65 by standard (simp add: fun_eq_iff add.assoc) |
66 |
66 |
67 instance "fun" :: (type, cancel_semigroup_add) cancel_semigroup_add |
67 instance "fun" :: (type, cancel_semigroup_add) cancel_semigroup_add |
68 by default (simp_all add: fun_eq_iff) |
68 by standard (simp_all add: fun_eq_iff) |
69 |
69 |
70 instance "fun" :: (type, ab_semigroup_add) ab_semigroup_add |
70 instance "fun" :: (type, ab_semigroup_add) ab_semigroup_add |
71 by default (simp add: fun_eq_iff add.commute) |
71 by standard (simp add: fun_eq_iff add.commute) |
72 |
72 |
73 instance "fun" :: (type, cancel_ab_semigroup_add) cancel_ab_semigroup_add |
73 instance "fun" :: (type, cancel_ab_semigroup_add) cancel_ab_semigroup_add |
74 by default (simp_all add: fun_eq_iff diff_diff_eq) |
74 by standard (simp_all add: fun_eq_iff diff_diff_eq) |
75 |
75 |
76 instance "fun" :: (type, monoid_add) monoid_add |
76 instance "fun" :: (type, monoid_add) monoid_add |
77 by default (simp_all add: fun_eq_iff) |
77 by standard (simp_all add: fun_eq_iff) |
78 |
78 |
79 instance "fun" :: (type, comm_monoid_add) comm_monoid_add |
79 instance "fun" :: (type, comm_monoid_add) comm_monoid_add |
80 by default simp |
80 by standard simp |
81 |
81 |
82 instance "fun" :: (type, cancel_comm_monoid_add) cancel_comm_monoid_add .. |
82 instance "fun" :: (type, cancel_comm_monoid_add) cancel_comm_monoid_add .. |
83 |
83 |
84 instance "fun" :: (type, group_add) group_add |
84 instance "fun" :: (type, group_add) group_add |
85 by default |
85 by standard (simp_all add: fun_eq_iff) |
86 (simp_all add: fun_eq_iff) |
|
87 |
86 |
88 instance "fun" :: (type, ab_group_add) ab_group_add |
87 instance "fun" :: (type, ab_group_add) ab_group_add |
89 by default simp_all |
88 by standard simp_all |
90 |
89 |
91 |
90 |
92 text \<open>Multiplicative structures\<close> |
91 text \<open>Multiplicative structures\<close> |
93 |
92 |
94 instance "fun" :: (type, semigroup_mult) semigroup_mult |
93 instance "fun" :: (type, semigroup_mult) semigroup_mult |
95 by default (simp add: fun_eq_iff mult.assoc) |
94 by standard (simp add: fun_eq_iff mult.assoc) |
96 |
95 |
97 instance "fun" :: (type, ab_semigroup_mult) ab_semigroup_mult |
96 instance "fun" :: (type, ab_semigroup_mult) ab_semigroup_mult |
98 by default (simp add: fun_eq_iff mult.commute) |
97 by standard (simp add: fun_eq_iff mult.commute) |
99 |
98 |
100 instance "fun" :: (type, monoid_mult) monoid_mult |
99 instance "fun" :: (type, monoid_mult) monoid_mult |
101 by default (simp_all add: fun_eq_iff) |
100 by standard (simp_all add: fun_eq_iff) |
102 |
101 |
103 instance "fun" :: (type, comm_monoid_mult) comm_monoid_mult |
102 instance "fun" :: (type, comm_monoid_mult) comm_monoid_mult |
104 by default simp |
103 by standard simp |
105 |
104 |
106 |
105 |
107 text \<open>Misc\<close> |
106 text \<open>Misc\<close> |
108 |
107 |
109 instance "fun" :: (type, "Rings.dvd") "Rings.dvd" .. |
108 instance "fun" :: (type, "Rings.dvd") "Rings.dvd" .. |
110 |
109 |
111 instance "fun" :: (type, mult_zero) mult_zero |
110 instance "fun" :: (type, mult_zero) mult_zero |
112 by default (simp_all add: fun_eq_iff) |
111 by standard (simp_all add: fun_eq_iff) |
113 |
112 |
114 instance "fun" :: (type, zero_neq_one) zero_neq_one |
113 instance "fun" :: (type, zero_neq_one) zero_neq_one |
115 by default (simp add: fun_eq_iff) |
114 by standard (simp add: fun_eq_iff) |
116 |
115 |
117 |
116 |
118 text \<open>Ring structures\<close> |
117 text \<open>Ring structures\<close> |
119 |
118 |
120 instance "fun" :: (type, semiring) semiring |
119 instance "fun" :: (type, semiring) semiring |
121 by default (simp_all add: fun_eq_iff algebra_simps) |
120 by standard (simp_all add: fun_eq_iff algebra_simps) |
122 |
121 |
123 instance "fun" :: (type, comm_semiring) comm_semiring |
122 instance "fun" :: (type, comm_semiring) comm_semiring |
124 by default (simp add: fun_eq_iff algebra_simps) |
123 by standard (simp add: fun_eq_iff algebra_simps) |
125 |
124 |
126 instance "fun" :: (type, semiring_0) semiring_0 .. |
125 instance "fun" :: (type, semiring_0) semiring_0 .. |
127 |
126 |
128 instance "fun" :: (type, comm_semiring_0) comm_semiring_0 .. |
127 instance "fun" :: (type, comm_semiring_0) comm_semiring_0 .. |
129 |
128 |
178 |
177 |
179 |
178 |
180 text \<open>Ordered structures\<close> |
179 text \<open>Ordered structures\<close> |
181 |
180 |
182 instance "fun" :: (type, ordered_ab_semigroup_add) ordered_ab_semigroup_add |
181 instance "fun" :: (type, ordered_ab_semigroup_add) ordered_ab_semigroup_add |
183 by default (auto simp add: le_fun_def intro: add_left_mono) |
182 by standard (auto simp add: le_fun_def intro: add_left_mono) |
184 |
183 |
185 instance "fun" :: (type, ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add .. |
184 instance "fun" :: (type, ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add .. |
186 |
185 |
187 instance "fun" :: (type, ordered_ab_semigroup_add_imp_le) ordered_ab_semigroup_add_imp_le |
186 instance "fun" :: (type, ordered_ab_semigroup_add_imp_le) ordered_ab_semigroup_add_imp_le |
188 by default (simp add: le_fun_def) |
187 by standard (simp add: le_fun_def) |
189 |
188 |
190 instance "fun" :: (type, ordered_comm_monoid_add) ordered_comm_monoid_add .. |
189 instance "fun" :: (type, ordered_comm_monoid_add) ordered_comm_monoid_add .. |
191 |
190 |
192 instance "fun" :: (type, ordered_ab_group_add) ordered_ab_group_add .. |
191 instance "fun" :: (type, ordered_ab_group_add) ordered_ab_group_add .. |
193 |
192 |
194 instance "fun" :: (type, ordered_semiring) ordered_semiring |
193 instance "fun" :: (type, ordered_semiring) ordered_semiring |
195 by default |
194 by standard (auto simp add: le_fun_def intro: mult_left_mono mult_right_mono) |
196 (auto simp add: le_fun_def intro: mult_left_mono mult_right_mono) |
|
197 |
195 |
198 instance "fun" :: (type, ordered_comm_semiring) ordered_comm_semiring |
196 instance "fun" :: (type, ordered_comm_semiring) ordered_comm_semiring |
199 by default (fact mult_left_mono) |
197 by standard (fact mult_left_mono) |
200 |
198 |
201 instance "fun" :: (type, ordered_cancel_semiring) ordered_cancel_semiring .. |
199 instance "fun" :: (type, ordered_cancel_semiring) ordered_cancel_semiring .. |
202 |
200 |
203 instance "fun" :: (type, ordered_cancel_comm_semiring) ordered_cancel_comm_semiring .. |
201 instance "fun" :: (type, ordered_cancel_comm_semiring) ordered_cancel_comm_semiring .. |
204 |
202 |