equal
deleted
inserted
replaced
7 *) |
7 *) |
8 |
8 |
9 open Holcfb; |
9 open Holcfb; |
10 |
10 |
11 (* ------------------------------------------------------------------------ *) |
11 (* ------------------------------------------------------------------------ *) |
12 (* <::nat=>nat=>bool is well-founded *) |
12 (* <::nat=>nat=>bool is a well-ordering *) |
13 (* ------------------------------------------------------------------------ *) |
13 (* ------------------------------------------------------------------------ *) |
14 |
14 |
15 val well_founded_nat = prove_goal Nat.thy |
15 val well_ordering_nat = prove_goal Nat.thy |
16 "!P. P(x::nat) --> (? y. P(y) & (! x. P(x) --> y <= x))" |
16 "!P. P(x::nat) --> (? y. P(y) & (! x. P(x) --> y <= x))" |
17 (fn prems => |
17 (fn prems => |
18 [ |
18 [ |
19 (res_inst_tac [("n","x")] less_induct 1), |
19 (res_inst_tac [("n","x")] less_induct 1), |
20 (strip_tac 1), |
20 (strip_tac 1), |
43 val theleast = prove_goalw Holcfb.thy [theleast_def] |
43 val theleast = prove_goalw Holcfb.thy [theleast_def] |
44 "P(x) ==> P(theleast(P)) & (!x.P(x)--> theleast(P) <= x)" |
44 "P(x) ==> P(theleast(P)) & (!x.P(x)--> theleast(P) <= x)" |
45 (fn prems => |
45 (fn prems => |
46 [ |
46 [ |
47 (cut_facts_tac prems 1), |
47 (cut_facts_tac prems 1), |
48 (rtac (well_founded_nat RS spec RS mp RS exE) 1), |
48 (rtac (well_ordering_nat RS spec RS mp RS exE) 1), |
49 (atac 1), |
49 (atac 1), |
50 (rtac selectI 1), |
50 (rtac selectI 1), |
51 (atac 1) |
51 (atac 1) |
52 ]); |
52 ]); |
53 |
53 |
148 |
148 |
149 |
149 |
150 val classical3 = (notE RS notI); |
150 val classical3 = (notE RS notI); |
151 (* [| ?P ==> ~ ?P1; ?P ==> ?P1 |] ==> ~ ?P *) |
151 (* [| ?P ==> ~ ?P1; ?P ==> ?P1 |] ==> ~ ?P *) |
152 |
152 |
|
153 |
|
154 val nat_less_cases = prove_goal Nat.thy |
|
155 "[| (m::nat) < n ==> P(n,m); m=n ==> P(n,m);n < m ==> P(n,m)|]==>P(n,m)" |
|
156 ( fn prems => |
|
157 [ |
|
158 (res_inst_tac [("m1","n"),("n1","m")] (less_linear RS disjE) 1), |
|
159 (etac disjE 2), |
|
160 (etac (hd (tl (tl prems))) 1), |
|
161 (etac (sym RS hd (tl prems)) 1), |
|
162 (etac (hd prems) 1) |
|
163 ]); |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |