equal
deleted
inserted
replaced
18 qed "partition_one"; |
18 qed "partition_one"; |
19 Addsimps [partition_one]; |
19 Addsimps [partition_one]; |
20 |
20 |
21 Goalw [partition_def] |
21 Goalw [partition_def] |
22 "a <= b ==> partition(a,b)(%n. if n = 0 then a else b)"; |
22 "a <= b ==> partition(a,b)(%n. if n = 0 then a else b)"; |
23 by (auto_tac (claset(),simpset() addsimps [real_le_less])); |
23 by (auto_tac (claset(),simpset() addsimps [order_le_less])); |
24 qed "partition_single"; |
24 qed "partition_single"; |
25 Addsimps [partition_single]; |
25 Addsimps [partition_single]; |
26 |
26 |
27 Goalw [partition_def] "partition(a,b) D ==> (D(0) = a)"; |
27 Goalw [partition_def] "partition(a,b) D ==> (D(0) = a)"; |
28 by Auto_tac; |
28 by Auto_tac; |
77 by (ALLGOALS(dtac (partition RS subst))); |
77 by (ALLGOALS(dtac (partition RS subst))); |
78 by (Step_tac 1); |
78 by (Step_tac 1); |
79 by (ALLGOALS(dtac (ARITH_PROVE "Suc m <= n ==> m < n"))); |
79 by (ALLGOALS(dtac (ARITH_PROVE "Suc m <= n ==> m < n"))); |
80 by (ALLGOALS(dtac less_le_trans)); |
80 by (ALLGOALS(dtac less_le_trans)); |
81 by (assume_tac 1 THEN assume_tac 2); |
81 by (assume_tac 1 THEN assume_tac 2); |
82 by (ALLGOALS(blast_tac (claset() addIs [real_less_trans]))); |
82 by (ALLGOALS(blast_tac (claset() addIs [order_less_trans]))); |
83 qed_spec_mp "lemma_partition_lt_gen"; |
83 qed_spec_mp "lemma_partition_lt_gen"; |
84 |
84 |
85 Goal "m < n ==> EX d. n = m + Suc d"; |
85 Goal "m < n ==> EX d. n = m + Suc d"; |
86 by (auto_tac (claset(),simpset() addsimps [less_iff_Suc_add])); |
86 by (auto_tac (claset(),simpset() addsimps [less_iff_Suc_add])); |
87 qed "less_eq_add_Suc"; |
87 qed "less_eq_add_Suc"; |
95 by (dtac (partition RS subst) 1); |
95 by (dtac (partition RS subst) 1); |
96 by (induct_tac "n" 1); |
96 by (induct_tac "n" 1); |
97 by (Blast_tac 1); |
97 by (Blast_tac 1); |
98 by (blast_tac (claset() addSDs [leI] addDs |
98 by (blast_tac (claset() addSDs [leI] addDs |
99 [(ARITH_PROVE "m <= n ==> m <= Suc n"), |
99 [(ARITH_PROVE "m <= n ==> m <= Suc n"), |
100 le_less_trans,real_less_trans]) 1); |
100 le_less_trans,order_less_trans]) 1); |
101 qed_spec_mp "partition_lt"; |
101 qed_spec_mp "partition_lt"; |
102 |
102 |
103 Goal "partition(a,b) D ==> a <= b"; |
103 Goal "partition(a,b) D ==> a <= b"; |
104 by (ftac (partition RS subst) 1); |
104 by (ftac (partition RS subst) 1); |
105 by (Step_tac 1); |
105 by (Step_tac 1); |
585 |
585 |
586 Goal "partition(a,b) D ==> psize D = (LEAST n. D(n) = b)"; |
586 Goal "partition(a,b) D ==> psize D = (LEAST n. D(n) = b)"; |
587 by (auto_tac (claset() addSIs [Least_equality RS sym,partition_rhs],simpset())); |
587 by (auto_tac (claset() addSIs [Least_equality RS sym,partition_rhs],simpset())); |
588 by (rtac ccontr 1); |
588 by (rtac ccontr 1); |
589 by (dtac partition_ub_lt 1); |
589 by (dtac partition_ub_lt 1); |
590 by Auto_tac; |
590 by (auto_tac (claset(), simpset() addsimps [linorder_not_less RS sym])); |
591 qed "partition_psize_Least"; |
591 qed "partition_psize_Least"; |
592 |
592 |
593 Goal "partition (a, c) D ==> ~ (EX n. c < D(n))"; |
593 Goal "partition (a, c) D ==> ~ (EX n. c < D(n))"; |
594 by (Step_tac 1); |
594 by (Step_tac 1); |
595 by (dres_inst_tac [("r","n")] partition_ub 1); |
595 by (dres_inst_tac [("r","n")] partition_ub 1); |