equal
deleted
inserted
replaced
147 (**** neg: the test for negative integers ****) |
147 (**** neg: the test for negative integers ****) |
148 |
148 |
149 |
149 |
150 Goalw [neg_def, int_def] "~ neg(int n)"; |
150 Goalw [neg_def, int_def] "~ neg(int n)"; |
151 by (Simp_tac 1); |
151 by (Simp_tac 1); |
152 qed "not_neg_nat"; |
152 qed "not_neg_int"; |
153 |
153 |
154 Goalw [neg_def, int_def] "neg(- (int (Suc n)))"; |
154 Goalw [neg_def, int_def] "neg(- (int (Suc n)))"; |
155 by (simp_tac (simpset() addsimps [zminus]) 1); |
155 by (simp_tac (simpset() addsimps [zminus]) 1); |
156 qed "neg_zminus_nat"; |
156 qed "neg_zminus_int"; |
157 |
157 |
158 Addsimps [neg_zminus_nat, not_neg_nat]; |
158 Addsimps [neg_zminus_int, not_neg_int]; |
159 |
159 |
160 |
160 |
161 (**** zadd: addition on Integ ****) |
161 (**** zadd: addition on Integ ****) |
162 |
162 |
163 (** Congruence property for addition **) |
163 (** Congruence property for addition **) |
376 |
376 |
377 Goal "(w::int) * (z1 - z2) = (w * z1) - (w * z2)"; |
377 Goal "(w::int) * (z1 - z2) = (w * z1) - (w * z2)"; |
378 by (simp_tac (simpset() addsimps [zmult_commute',zdiff_zmult_distrib]) 1); |
378 by (simp_tac (simpset() addsimps [zmult_commute',zdiff_zmult_distrib]) 1); |
379 qed "zdiff_zmult_distrib2"; |
379 qed "zdiff_zmult_distrib2"; |
380 |
380 |
|
381 Goalw [int_def] "(int m) * (int n) = int (m * n)"; |
|
382 by (simp_tac (simpset() addsimps [zmult]) 1); |
|
383 qed "zmult_int"; |
|
384 |
381 Goalw [int_def] "int 0 * z = int 0"; |
385 Goalw [int_def] "int 0 * z = int 0"; |
382 by (res_inst_tac [("z","z")] eq_Abs_Integ 1); |
386 by (res_inst_tac [("z","z")] eq_Abs_Integ 1); |
383 by (asm_simp_tac (simpset() addsimps [zmult]) 1); |
387 by (asm_simp_tac (simpset() addsimps [zmult]) 1); |
384 qed "zmult_int0"; |
388 qed "zmult_int0"; |
385 |
389 |