src/ZF/Arith.ML
changeset 8551 5c22595bc599
parent 8201 a81d18b0a9b1
child 9301 de04717eed78
equal deleted inserted replaced
8550:b44c185f8018 8551:5c22595bc599
   244 by (induct_tac "k" 1);
   244 by (induct_tac "k" 1);
   245 by (ALLGOALS Asm_simp_tac);
   245 by (ALLGOALS Asm_simp_tac);
   246 qed "diff_cancel";
   246 qed "diff_cancel";
   247 
   247 
   248 Goal "[| k:nat; m: nat; n: nat |] ==> (m#+k) #- (n#+k) = m #- n";
   248 Goal "[| k:nat; m: nat; n: nat |] ==> (m#+k) #- (n#+k) = m #- n";
   249 val add_commute_k = read_instantiate [("n","k")] add_commute;
   249 by (asm_simp_tac
   250 by (asm_simp_tac (simpset() addsimps [add_commute_k, diff_cancel]) 1);
   250     (simpset() addsimps [inst "n" "k" add_commute, diff_cancel]) 1);
   251 qed "diff_cancel2";
   251 qed "diff_cancel2";
   252 
   252 
   253 Goal "[| m:nat;  n:nat |] ==> n #- (n#+m) = 0";
   253 Goal "[| m:nat;  n:nat |] ==> n #- (n#+m) = 0";
   254 by (induct_tac "n" 1);
   254 by (induct_tac "n" 1);
   255 by Auto_tac;
   255 by Auto_tac;
   261 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
   261 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
   262 by (ALLGOALS (asm_simp_tac (simpset() addsimps [diff_cancel])));
   262 by (ALLGOALS (asm_simp_tac (simpset() addsimps [diff_cancel])));
   263 qed "diff_mult_distrib" ;
   263 qed "diff_mult_distrib" ;
   264 
   264 
   265 Goal "[| m:nat; n: nat; k:nat |] ==> k #* (m #- n) = (k #* m) #- (k #* n)";
   265 Goal "[| m:nat; n: nat; k:nat |] ==> k #* (m #- n) = (k #* m) #- (k #* n)";
   266 val mult_commute_k = read_instantiate [("m","k")] mult_commute;
   266 by (asm_simp_tac
   267 by (asm_simp_tac (simpset() addsimps 
   267     (simpset() addsimps [inst "m" "k" mult_commute, diff_mult_distrib]) 1);
   268                   [mult_commute_k, diff_mult_distrib]) 1);
       
   269 qed "diff_mult_distrib2" ;
   268 qed "diff_mult_distrib2" ;
   270 
   269 
   271 (*** Remainder ***)
   270 (*** Remainder ***)
   272 
   271 
   273 Goal "[| 0<n;  n le m;  m:nat |] ==> m #- n < m";
   272 Goal "[| 0<n;  n le m;  m:nat |] ==> m #- n < m";