diff -r 295bb029170c -r a356fb49e69e src/HOL/Integ/IntDef.ML --- a/src/HOL/Integ/IntDef.ML Tue Sep 29 12:07:31 1998 +0200 +++ b/src/HOL/Integ/IntDef.ML Tue Sep 29 15:57:42 1998 +0200 @@ -137,7 +137,7 @@ by (Asm_full_simp_tac 1); qed "inj_zminus"; -Goalw [int_def] "- ($# 0) = $# 0"; +Goalw [int_def] "- (int 0) = int 0"; by (simp_tac (simpset() addsimps [zminus]) 1); qed "zminus_nat0"; @@ -147,12 +147,12 @@ (**** neg: the test for negative integers ****) -Goalw [neg_def, int_def] "~ neg($# n)"; +Goalw [neg_def, int_def] "~ neg(int n)"; by (Simp_tac 1); by Safe_tac; qed "not_neg_nat"; -Goalw [neg_def, int_def] "neg(- $# Suc(n))"; +Goalw [neg_def, int_def] "neg(- (int (Suc n)))"; by (simp_tac (simpset() addsimps [zminus]) 1); qed "neg_zminus_nat"; @@ -214,30 +214,30 @@ (*Integer addition is an AC operator*) val zadd_ac = [zadd_assoc,zadd_commute,zadd_left_commute]; -Goalw [int_def] "($#m) + ($#n) = $# (m + n)"; +Goalw [int_def] "(int m) + (int n) = int (m + n)"; by (simp_tac (simpset() addsimps [zadd]) 1); -qed "add_nat"; +qed "zadd_int"; -Goal "$# (Suc m) = $# 1 + ($# m)"; -by (simp_tac (simpset() addsimps [add_nat]) 1); +Goal "int (Suc m) = int 1 + (int m)"; +by (simp_tac (simpset() addsimps [zadd_int]) 1); qed "int_Suc"; -Goalw [int_def] "$# 0 + z = z"; +Goalw [int_def] "int 0 + z = z"; by (res_inst_tac [("z","z")] eq_Abs_Integ 1); by (asm_simp_tac (simpset() addsimps [zadd]) 1); qed "zadd_nat0"; -Goal "z + $# 0 = z"; +Goal "z + int 0 = z"; by (rtac (zadd_commute RS trans) 1); by (rtac zadd_nat0 1); qed "zadd_nat0_right"; -Goalw [int_def] "z + (- z) = $# 0"; +Goalw [int_def] "z + (- z) = int 0"; by (res_inst_tac [("z","z")] eq_Abs_Integ 1); by (asm_simp_tac (simpset() addsimps [zminus, zadd, add_commute]) 1); qed "zadd_zminus_inverse_nat"; -Goal "(- z) + z = $# 0"; +Goal "(- z) + z = int 0"; by (rtac (zadd_commute RS trans) 1); by (rtac zadd_zminus_inverse_nat 1); qed "zadd_zminus_inverse_nat2"; @@ -246,15 +246,25 @@ zadd_zminus_inverse_nat, zadd_zminus_inverse_nat2]; Goal "z + (- z + w) = (w::int)"; -by (asm_simp_tac (simpset() addsimps [zadd_assoc RS sym]) 1); +by (simp_tac (simpset() addsimps [zadd_assoc RS sym]) 1); qed "zadd_zminus_cancel"; Goal "(-z) + (z + w) = (w::int)"; -by (asm_simp_tac (simpset() addsimps [zadd_assoc RS sym]) 1); +by (simp_tac (simpset() addsimps [zadd_assoc RS sym]) 1); qed "zminus_zadd_cancel"; Addsimps [zadd_zminus_cancel, zminus_zadd_cancel]; +Goal "int 0 - x = -x"; +by (simp_tac (simpset() addsimps [zdiff_def]) 1); +qed "zdiff_nat0"; + +Goal "x - int 0 = x"; +by (simp_tac (simpset() addsimps [zdiff_def]) 1); +qed "zdiff_nat0_right"; + +Addsimps [zdiff_nat0, zdiff_nat0_right]; + (** Lemmas **) @@ -362,21 +372,21 @@ by (simp_tac (simpset() addsimps [zmult_commute',zadd_zmult_distrib]) 1); qed "zadd_zmult_distrib2"; -Goalw [int_def] "$# 0 * z = $# 0"; +Goalw [int_def] "int 0 * z = int 0"; by (res_inst_tac [("z","z")] eq_Abs_Integ 1); by (asm_simp_tac (simpset() addsimps [zmult]) 1); qed "zmult_nat0"; -Goalw [int_def] "$# 1 * z = z"; +Goalw [int_def] "int 1 * z = z"; by (res_inst_tac [("z","z")] eq_Abs_Integ 1); by (asm_simp_tac (simpset() addsimps [zmult]) 1); qed "zmult_nat1"; -Goal "z * $# 0 = $# 0"; +Goal "z * int 0 = int 0"; by (rtac ([zmult_commute, zmult_nat0] MRS trans) 1); qed "zmult_nat0_right"; -Goal "z * $# 1 = z"; +Goal "z * int 1 = z"; by (rtac ([zmult_commute, zmult_nat1] MRS trans) 1); qed "zmult_nat1_right"; @@ -394,7 +404,7 @@ (*This lemma allows direct proofs of other <-properties*) Goalw [zless_def, neg_def, zdiff_def, int_def] - "(w < z) = (EX n. z = w + $#(Suc n))"; + "(w < z) = (EX n. z = w + int(Suc n))"; by (res_inst_tac [("z","z")] eq_Abs_Integ 1); by (res_inst_tac [("z","w")] eq_Abs_Integ 1); by (Clarify_tac 1); @@ -404,16 +414,16 @@ by (ALLGOALS (asm_full_simp_tac (simpset() addsimps add_ac))); qed "zless_iff_Suc_zadd"; -Goal "z < z + $# (Suc n)"; +Goal "z < z + int (Suc n)"; by (auto_tac (claset(), simpset() addsimps [zless_iff_Suc_zadd, zadd_assoc, - add_nat])); + zadd_int])); qed "zless_zadd_Suc"; Goal "[| z1 z1 < (z3::int)"; by (auto_tac (claset(), simpset() addsimps [zless_iff_Suc_zadd, zadd_assoc, - add_nat])); + zadd_int])); qed "zless_trans"; Goal "!!w::int. z ~w z<=(w::int)"; by (assume_tac 1); @@ -633,10 +643,9 @@ Addsimps [zadd_right_cancel]; -Goal "(w < z + $# 1) = (w