102 and "mult \<Z> x y = x * y" |
102 and "mult \<Z> x y = x * y" |
103 and "one \<Z> = 1" |
103 and "one \<Z> = 1" |
104 and "pow \<Z> x n = x^n" |
104 and "pow \<Z> x n = x^n" |
105 proof - |
105 proof - |
106 -- "Specification" |
106 -- "Specification" |
107 show "monoid \<Z>" by (unfold_locales) (auto simp: int_ring_def) |
107 show "monoid \<Z>" proof qed (auto simp: int_ring_def) |
108 then interpret int: monoid ["\<Z>"] . |
108 then interpret int: monoid ["\<Z>"] . |
109 |
109 |
110 -- "Carrier" |
110 -- "Carrier" |
111 show "carrier \<Z> = UNIV" by (simp add: int_ring_def) |
111 show "carrier \<Z> = UNIV" by (simp add: int_ring_def) |
112 |
112 |
119 |
119 |
120 interpretation int: comm_monoid ["\<Z>"] |
120 interpretation int: comm_monoid ["\<Z>"] |
121 where "finprod \<Z> f A = (if finite A then setprod f A else undefined)" |
121 where "finprod \<Z> f A = (if finite A then setprod f A else undefined)" |
122 proof - |
122 proof - |
123 -- "Specification" |
123 -- "Specification" |
124 show "comm_monoid \<Z>" by (unfold_locales) (auto simp: int_ring_def) |
124 show "comm_monoid \<Z>" proof qed (auto simp: int_ring_def) |
125 then interpret int: comm_monoid ["\<Z>"] . |
125 then interpret int: comm_monoid ["\<Z>"] . |
126 |
126 |
127 -- "Operations" |
127 -- "Operations" |
128 { fix x y have "mult \<Z> x y = x * y" by (simp add: int_ring_def) } |
128 { fix x y have "mult \<Z> x y = x * y" by (simp add: int_ring_def) } |
129 note mult = this |
129 note mult = this |
144 where "zero \<Z> = 0" |
144 where "zero \<Z> = 0" |
145 and "add \<Z> x y = x + y" |
145 and "add \<Z> x y = x + y" |
146 and "finsum \<Z> f A = (if finite A then setsum f A else undefined)" |
146 and "finsum \<Z> f A = (if finite A then setsum f A else undefined)" |
147 proof - |
147 proof - |
148 -- "Specification" |
148 -- "Specification" |
149 show "abelian_monoid \<Z>" by (unfold_locales) (auto simp: int_ring_def) |
149 show "abelian_monoid \<Z>" proof qed (auto simp: int_ring_def) |
150 then interpret int: abelian_monoid ["\<Z>"] . |
150 then interpret int: abelian_monoid ["\<Z>"] . |
151 |
151 |
152 -- "Operations" |
152 -- "Operations" |
153 { fix x y show "add \<Z> x y = x + y" by (simp add: int_ring_def) } |
153 { fix x y show "add \<Z> x y = x + y" by (simp add: int_ring_def) } |
154 note add = this |
154 note add = this |
209 where "carrier (| carrier = UNIV::int set, eq = op =, le = op \<le> |) = UNIV" |
209 where "carrier (| carrier = UNIV::int set, eq = op =, le = op \<le> |) = UNIV" |
210 and "le (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x \<le> y)" |
210 and "le (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x \<le> y)" |
211 and "lless (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x < y)" |
211 and "lless (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x < y)" |
212 proof - |
212 proof - |
213 show "partial_order (| carrier = UNIV::int set, eq = op =, le = op \<le> |)" |
213 show "partial_order (| carrier = UNIV::int set, eq = op =, le = op \<le> |)" |
214 by unfold_locales simp_all |
214 proof qed simp_all |
215 show "carrier (| carrier = UNIV::int set, eq = op =, le = op \<le> |) = UNIV" |
215 show "carrier (| carrier = UNIV::int set, eq = op =, le = op \<le> |) = UNIV" |
216 by simp |
216 by simp |
217 show "le (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x \<le> y)" |
217 show "le (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x \<le> y)" |
218 by simp |
218 by simp |
219 show "lless (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x < y)" |
219 show "lless (| carrier = UNIV::int set, eq = op =, le = op \<le> |) x y = (x < y)" |