<commit_before>(*  Title       : Even.ML
    Author      : <NAME>  
    Copyright   : 1999  University of Edinburgh
    Description : Even numbers defined
*)

Goal "even(Suc(Suc n)) = (even(n))";
by (Auto_tac);
qed "even_Suc_Suc";
Addsimps [even_Suc_Suc];

Goal "(even(n)) = (~odd(n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_not_odd";

Goal "(odd(n)) = (~even(n))";
by (simp_tac (simpset() addsimps [even_not_odd]) 1);
qed "odd_not_even";

Goal "even(2*n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_mult_two";
Addsimps [even_mult_two];

Goal "even(n*2)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_mult_two'";
Addsimps [even_mult_two'];

Goal "even(n + n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_sum_self";
Addsimps [even_sum_self];

Goal "~odd(2*n)";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_odd_self_mult2";
Addsimps [not_odd_self_mult2];

Goal "~odd(n + n)";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_odd_sum_self";
Addsimps [not_odd_sum_self];

Goal "~even(Suc(n + n))";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_even_Suc_sum_self";
Addsimps [not_even_Suc_sum_self];

Goal "odd(Suc(2*n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_mult_two_add_one";
Addsimps [odd_mult_two_add_one];

Goal "odd(Suc(n + n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_sum_Suc_self";
Addsimps [odd_sum_Suc_self];

Goal "even(Suc n) = odd(n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_Suc_odd_iff";

Goal "odd(Suc n) = even(n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_Suc_even_iff";

Goal "even n | odd n";
by (simp_tac (simpset() addsimps [even_not_odd]) 1);
qed "even_odd_disj";

(* could be proved automatically before: spoiled by numeral arith! *)
Goal "EX m. (n = 2*m | n = Suc(2*m))";
by (induct_tac "n" 1 THEN Auto_tac);
by (res_inst_tac [("x","Suc m")] exI 1 THEN Auto_tac);
qed "nat_mult_two_Suc_disj";

Goal "even(n) = (EX m. n = 2*m)";
by (cut_inst_tac [("n","n")] nat_mult_two_Suc_disj 1);
by (Auto_tac);
qed "even_mult_two_ex";

Goal "odd(n) = (EX m. n = Suc (2*m))";
by (cut_inst_tac [("n","n")] nat_mult_two_Suc_disj 1);
by (Auto_tac);
qed "odd_Suc_mult_two_ex";

Goal "even(n) ==> even(m*n)";
by (auto_tac (claset(),
              simpset() addsimps [add_mult_distrib2, even_mult_two_ex]));
qed "even_mult_even";
Addsimps [even_mult_even];

Goal "(m*2) div 2 = (m::nat)";
by (rtac div_mult_self_is_m 1);
by (Simp_tac 1);
qed "div_mult_self_two_is_m";

Goal "(m + m) div 2 = (m::nat)";
by (asm_full_simp_tac (simpset() addsimps [m_add_m_eq2]) 1); 
qed "div_add_self_two_is_m";
Addsimps [div_add_self_two_is_m];

Goal "((m + m) + 2) div 2 = Suc m";
by (stac div_add_self2 1);
by (Auto_tac);
qed "div_add_self_two";

Goal "Suc(Suc(m*2)) div 2 = Suc m";
by (cut_inst_tac [("m","m")] div_add_self_two 1);
by (auto_tac (claset(),simpset() addsimps [m_add_m_eq2, mult_commute]));
qed "div_mult_self_Suc_Suc";
Addsimps [div_mult_self_Suc_Suc];

Goal "Suc(Suc(2*m)) div 2 = Suc m";
by (auto_tac (claset(),simpset() addsimps [mult_commute]));
qed "div_mult_self_Suc_Suc2";
Addsimps [div_mult_self_Suc_Suc2];

Goal "Suc(Suc(m + m)) div 2 = Suc m";
by (cut_inst_tac [("m","m")] div_mult_self_Suc_Suc 1);<commit_msg>Removed superfluous thm<commit_after>(*  Title       : Even.ML
    Author      : <NAME>  
    Copyright   : 1999  University of Edinburgh
    Description : Even numbers defined
*)

Goal "even(Suc(Suc n)) = (even(n))";
by (Auto_tac);
qed "even_Suc_Suc";
Addsimps [even_Suc_Suc];

Goal "(even(n)) = (~odd(n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_not_odd";

Goal "(odd(n)) = (~even(n))";
by (simp_tac (simpset() addsimps [even_not_odd]) 1);
qed "odd_not_even";

Goal "even(2*n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_mult_two";
Addsimps [even_mult_two];

Goal "even(n*2)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_mult_two'";
Addsimps [even_mult_two'];

Goal "even(n + n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_sum_self";
Addsimps [even_sum_self];

Goal "~odd(2*n)";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_odd_self_mult2";
Addsimps [not_odd_self_mult2];

Goal "~odd(n + n)";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_odd_sum_self";
Addsimps [not_odd_sum_self];

Goal "~even(Suc(n + n))";
by (induct_tac "n" 1);
by Auto_tac;
qed "not_even_Suc_sum_self";
Addsimps [not_even_Suc_sum_self];

Goal "odd(Suc(2*n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_mult_two_add_one";
Addsimps [odd_mult_two_add_one];

Goal "odd(Suc(n + n))";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_sum_Suc_self";
Addsimps [odd_sum_Suc_self];

Goal "even(Suc n) = odd(n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "even_Suc_odd_iff";

Goal "odd(Suc n) = even(n)";
by (induct_tac "n" 1);
by (Auto_tac);
qed "odd_Suc_even_iff";

Goal "even n | odd n";
by (simp_tac (simpset() addsimps [even_not_odd]) 1);
qed "even_odd_disj";

(* could be proved automatically before: spoiled by numeral arith! *)
Goal "EX m. (n = 2*m | n = Suc(2*m))";
by (induct_tac "n" 1 THEN Auto_tac);
by (res_inst_tac [("x","Suc m")] exI 1 THEN Auto_tac);
qed "nat_mult_two_Suc_disj";

Goal "even(n) = (EX m. n = 2*m)";
by (cut_inst_tac [("n","n")] nat_mult_two_Suc_disj 1);
by (Auto_tac);
qed "even_mult_two_ex";

Goal "odd(n) = (EX m. n = Suc (2*m))";
by (cut_inst_tac [("n","n")] nat_mult_two_Suc_disj 1);
by (Auto_tac);
qed "odd_Suc_mult_two_ex";

Goal "even(n) ==> even(m*n)";
by (auto_tac (claset(),
              simpset() addsimps [add_mult_distrib2, even_mult_two_ex]));
qed "even_mult_even";
Addsimps [even_mult_even];

Goal "(m + m) div 2 = (m::nat)";
by (asm_full_simp_tac (simpset() addsimps [m_add_m_eq2]) 1); 
qed "div_add_self_two_is_m";
Addsimps [div_add_self_two_is_m];

Goal "((m + m) + 2) div 2 = Suc m";
by (stac div_add_self2 1);
by (Auto_tac);
qed "div_add_self_two";

Goal "Suc(Suc(m*2)) div 2 = Suc m";
by (cut_inst_tac [("m","m")] div_add_self_two 1);
by (auto_tac (claset(),simpset() addsimps [m_add_m_eq2, mult_commute]));
qed "div_mult_self_Suc_Suc";
Addsimps [div_mult_self_Suc_Suc];

Goal "Suc(Suc(2*m)) div 2 = Suc m";
by (auto_tac (claset(),simpset() addsimps [mult_commute]));
qed "div_mult_self_Suc_Suc2";
Addsimps [div_mult_self_Suc_Suc2];

Goal "Suc(Suc(m + m)) div 2 = Suc m";
by (cut_inst_tac [("m","m")] div_mult_self_Suc_Suc 1);
{'fraction_non_alphanumeric': 0.18426534209261336, 'fraction_numerical': 0.01634353468995353, 'mean_word_length': 5.882028665931643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2947535', 'n_tokens_mistral': 3188, 'n_tokens_neox': 3108, 'n_words': 695}