src/HOL/Integ/NatBin.ML
changeset 8423 3c19160b6432
parent 8257 fe9bf28e8a58
child 8442 96023903c2df
equal deleted inserted replaced
8422:6c6a5410a9bd 8423:3c19160b6432
   317 qed "Suc_eq_add_numeral_1";
   317 qed "Suc_eq_add_numeral_1";
   318 
   318 
   319 (* These two can be useful when m = number_of... *)
   319 (* These two can be useful when m = number_of... *)
   320 
   320 
   321 Goal "(m::nat) + n = (if m=#0 then n else Suc ((m - #1) + n))";
   321 Goal "(m::nat) + n = (if m=#0 then n else Suc ((m - #1) + n))";
   322 by (exhaust_tac "m" 1);
   322 by (cases_tac "m" 1);
   323 by (ALLGOALS (asm_simp_tac numeral_ss));
   323 by (ALLGOALS (asm_simp_tac numeral_ss));
   324 qed "add_eq_if";
   324 qed "add_eq_if";
   325 
   325 
   326 Goal "(m::nat) * n = (if m=#0 then #0 else n + ((m - #1) * n))";
   326 Goal "(m::nat) * n = (if m=#0 then #0 else n + ((m - #1) * n))";
   327 by (exhaust_tac "m" 1);
   327 by (cases_tac "m" 1);
   328 by (ALLGOALS (asm_simp_tac numeral_ss));
   328 by (ALLGOALS (asm_simp_tac numeral_ss));
   329 qed "mult_eq_if";
   329 qed "mult_eq_if";
   330 
   330 
   331 Goal "(p ^ m :: nat) = (if m=#0 then #1 else p * (p ^ (m - #1)))";
   331 Goal "(p ^ m :: nat) = (if m=#0 then #1 else p * (p ^ (m - #1)))";
   332 by (exhaust_tac "m" 1);
   332 by (cases_tac "m" 1);
   333 by (ALLGOALS (asm_simp_tac numeral_ss));
   333 by (ALLGOALS (asm_simp_tac numeral_ss));
   334 qed "power_eq_if";
   334 qed "power_eq_if";
   335 
   335 
   336 Goal "[| #0<n; #0<m |] ==> m - n < (m::nat)";
   336 Goal "[| #0<n; #0<m |] ==> m - n < (m::nat)";
   337 by (asm_full_simp_tac (numeral_ss addsimps [diff_less]) 1);
   337 by (asm_full_simp_tac (numeral_ss addsimps [diff_less]) 1);