src/ZF/Integ/Bin.ML
changeset 9576 3df14e0a3a51
parent 9570 e16e168984e1
child 9578 ab26d6c8ebfe
equal deleted inserted replaced
9575:af71f5f4ca6b 9576:3df14e0a3a51
   258 
   258 
   259 Goal "$#0 = #0";
   259 Goal "$#0 = #0";
   260 by (Simp_tac 1);
   260 by (Simp_tac 1);
   261 qed "int_of_0";
   261 qed "int_of_0";
   262 
   262 
       
   263 Goal "$# succ(n) = #1 $+ $#n";
       
   264 by (simp_tac (simpset() addsimps [int_of_add RS sym, natify_succ]) 1);
       
   265 qed "int_of_succ";
       
   266 
       
   267 Goal "$- #0 = #0";
       
   268 by (Simp_tac 1);
       
   269 qed "zminus_0";
       
   270 
       
   271 Addsimps [zminus_0];
       
   272 
   263 Goal "#0 $+ z = intify(z)";
   273 Goal "#0 $+ z = intify(z)";
   264 by (Simp_tac 1);
   274 by (Simp_tac 1);
   265 qed "zadd_0_intify";
   275 qed "zadd_0_intify";
   266 
   276 
   267 Goal "z $+ #0 = intify(z)";
   277 Goal "z $+ #0 = intify(z)";
   300 by (stac zmult_commute 1);
   310 by (stac zmult_commute 1);
   301 by (rtac zmult_minus1 1);
   311 by (rtac zmult_minus1 1);
   302 qed "zmult_minus1_right";
   312 qed "zmult_minus1_right";
   303 
   313 
   304 Addsimps [zmult_minus1, zmult_minus1_right];
   314 Addsimps [zmult_minus1, zmult_minus1_right];
       
   315 
       
   316 (*beware!  LOOPS with int_combine_numerals simproc*)
       
   317 Goal "#2 $* z = z $+ z";
       
   318 by (simp_tac (simpset() addsimps [zadd_zmult_distrib]) 1);
       
   319 qed "zmult_2";
   305 
   320 
   306 
   321 
   307 (*** Simplification rules for comparison of binary numbers (N Voelker) ***)
   322 (*** Simplification rules for comparison of binary numbers (N Voelker) ***)
   308 
   323 
   309 (** Equals (=) **)
   324 (** Equals (=) **)
   468 by (ALLGOALS (asm_simp_tac (simpset() addsimps zdiff_def::zadd_ac)));
   483 by (ALLGOALS (asm_simp_tac (simpset() addsimps zdiff_def::zadd_ac)));
   469 qed "add_integ_of_diff2";
   484 qed "add_integ_of_diff2";
   470 
   485 
   471 Addsimps [add_integ_of_left, mult_integ_of_left,
   486 Addsimps [add_integ_of_left, mult_integ_of_left,
   472 	  add_integ_of_diff1, add_integ_of_diff2]; 
   487 	  add_integ_of_diff1, add_integ_of_diff2]; 
       
   488 
       
   489 
       
   490 (** More for integer constants **)
       
   491 
       
   492 Addsimps [int_of_0, int_of_succ];
       
   493 
       
   494 Goal "#0 $- x = $-x";
       
   495 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
       
   496 qed "zdiff0";
       
   497 
       
   498 Goal "x $- #0 = intify(x)";
       
   499 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
       
   500 qed "zdiff0_right";
       
   501 
       
   502 Goal "x $- x = #0";
       
   503 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
       
   504 qed "zdiff_self";
       
   505 
       
   506 Addsimps [zdiff0, zdiff0_right, zdiff_self];
       
   507 
       
   508 Goal "[| znegative(k); k: int |] ==> k $< #0";
       
   509 by (asm_simp_tac (simpset() addsimps [zless_def]) 1);
       
   510 qed "znegative_imp_zless_0";
       
   511 
       
   512 Goal "[| #0 $< k; k: int |] ==> znegative($-k)";
       
   513 by (asm_full_simp_tac (simpset() addsimps [zless_def]) 1);
       
   514 qed "zero_zless_imp_znegative_zminus";
       
   515