9907
|
1 |
(* Title: ZF/OrdQuant.ML
|
2469
|
2 |
ID: $Id$
|
|
3 |
Authors: Krzysztof Grabczewski and L C Paulson
|
|
4 |
|
|
5 |
Quantifiers and union operator for ordinals.
|
|
6 |
*)
|
|
7 |
|
12620
|
8 |
val oall_def = thm "oall_def";
|
|
9 |
val oex_def = thm "oex_def";
|
|
10 |
val OUnion_def = thm "OUnion_def";
|
|
11 |
|
2469
|
12 |
(*** universal quantifier for ordinals ***)
|
|
13 |
|
9211
|
14 |
val prems = Goalw [oall_def]
|
|
15 |
"[| !!x. x<A ==> P(x) |] ==> ALL x<A. P(x)";
|
|
16 |
by (REPEAT (ares_tac (prems @ [allI,impI]) 1)) ;
|
|
17 |
qed "oallI";
|
2469
|
18 |
|
9211
|
19 |
Goalw [oall_def] "[| ALL x<A. P(x); x<A |] ==> P(x)";
|
|
20 |
by (etac (spec RS mp) 1);
|
|
21 |
by (assume_tac 1) ;
|
|
22 |
qed "ospec";
|
2469
|
23 |
|
9211
|
24 |
val major::prems = Goalw [oall_def]
|
|
25 |
"[| ALL x<A. P(x); P(x) ==> Q; ~x<A ==> Q |] ==> Q";
|
|
26 |
by (rtac (major RS allE) 1);
|
|
27 |
by (REPEAT (eresolve_tac (prems@[asm_rl,impCE]) 1)) ;
|
|
28 |
qed "oallE";
|
2469
|
29 |
|
9211
|
30 |
val major::prems = Goal
|
9180
|
31 |
"[| ALL x<A. P(x); ~x<A ==> Q; P(x) ==> Q |] ==> Q";
|
|
32 |
by (rtac (major RS oallE) 1);
|
|
33 |
by (REPEAT (eresolve_tac prems 1)) ;
|
|
34 |
qed "rev_oallE";
|
2469
|
35 |
|
|
36 |
(*Trival rewrite rule; (ALL x<a.P)<->P holds only if a is not 0!*)
|
9180
|
37 |
Goal "(ALL x<a. True) <-> True";
|
|
38 |
by (REPEAT (ares_tac [TrueI,oallI,iffI] 1)) ;
|
|
39 |
qed "oall_simp";
|
2469
|
40 |
|
|
41 |
(*Congruence rule for rewriting*)
|
9211
|
42 |
val prems = Goalw [oall_def]
|
|
43 |
"[| a=a'; !!x. x<a' ==> P(x) <-> P'(x) |] ==> oall(a,P) <-> oall(a',P')";
|
|
44 |
by (simp_tac (simpset() addsimps prems) 1) ;
|
|
45 |
qed "oall_cong";
|
2469
|
46 |
|
|
47 |
|
|
48 |
(*** existential quantifier for ordinals ***)
|
|
49 |
|
9211
|
50 |
val prems = Goalw [oex_def]
|
|
51 |
"[| P(x); x<A |] ==> EX x<A. P(x)";
|
|
52 |
by (REPEAT (ares_tac (prems @ [exI,conjI]) 1)) ;
|
|
53 |
qed "oexI";
|
2469
|
54 |
|
|
55 |
(*Not of the general form for such rules; ~EX has become ALL~ *)
|
9180
|
56 |
val prems = Goal
|
|
57 |
"[| ALL x<A. ~P(x) ==> P(a); a<A |] ==> EX x<A. P(x)";
|
|
58 |
by (rtac classical 1);
|
|
59 |
by (REPEAT (ares_tac (prems@[oexI,oallI,notI,notE]) 1)) ;
|
|
60 |
qed "oexCI";
|
2469
|
61 |
|
9211
|
62 |
val major::prems = Goalw [oex_def]
|
2469
|
63 |
"[| EX x<A. P(x); !!x. [| x<A; P(x) |] ==> Q \
|
9211
|
64 |
\ |] ==> Q";
|
|
65 |
by (rtac (major RS exE) 1);
|
|
66 |
by (REPEAT (eresolve_tac (prems @ [asm_rl,conjE]) 1)) ;
|
|
67 |
qed "oexE";
|
2469
|
68 |
|
9211
|
69 |
val prems = Goalw [oex_def]
|
2469
|
70 |
"[| a=a'; !!x. x<a' ==> P(x) <-> P'(x) \
|
9211
|
71 |
\ |] ==> oex(a,P) <-> oex(a',P')";
|
|
72 |
by (simp_tac (simpset() addsimps prems addcongs [conj_cong]) 1) ;
|
|
73 |
qed "oex_cong";
|
2469
|
74 |
|
|
75 |
|
|
76 |
(*** Rules for Ordinal-Indexed Unions ***)
|
|
77 |
|
9211
|
78 |
Goalw [OUnion_def] "[| a<i; b: B(a) |] ==> b: (UN z<i. B(z))";
|
|
79 |
by (blast_tac (claset() addSEs [ltE]) 1);
|
|
80 |
qed "OUN_I";
|
2469
|
81 |
|
9211
|
82 |
val major::prems = Goalw [OUnion_def]
|
|
83 |
"[| b : (UN z<i. B(z)); !!a.[| b: B(a); a<i |] ==> R |] ==> R";
|
|
84 |
by (rtac (major RS CollectE) 1);
|
|
85 |
by (rtac UN_E 1);
|
|
86 |
by (REPEAT (ares_tac (ltI::prems) 1)) ;
|
|
87 |
qed "OUN_E";
|
2469
|
88 |
|
9211
|
89 |
Goalw [oex_def] "b : (UN x<i. B(x)) <-> (EX x<i. b : B(x))";
|
|
90 |
by (fast_tac (claset() addIs [OUN_I] addSEs [OUN_E]) 1) ;
|
|
91 |
qed "OUN_iff";
|
2469
|
92 |
|
9180
|
93 |
val prems = Goal
|
|
94 |
"[| i=j; !!x. x<j ==> C(x)=D(x) |] ==> (UN x<i. C(x)) = (UN x<j. D(x))";
|
|
95 |
by (rtac equality_iffI 1);
|
|
96 |
by (simp_tac (simpset() addcongs [oex_cong] addsimps OUN_iff::prems) 1) ;
|
|
97 |
qed "OUN_cong";
|
2469
|
98 |
|
|
99 |
AddSIs [oallI];
|
|
100 |
AddIs [oexI, OUN_I];
|
|
101 |
AddSEs [oexE, OUN_E];
|
|
102 |
AddEs [rev_oallE];
|
|
103 |
|
9907
|
104 |
val Ord_atomize = atomize (("OrdQuant.oall", [ospec])::ZF_conn_pairs, ZF_mem_pairs);
|
2469
|
105 |
|
12725
|
106 |
simpset_ref() := simpset() setmksimps (map mk_eq o Ord_atomize o gen_all)
|
2469
|
107 |
addsimps [oall_simp, ltD RS beta]
|
|
108 |
addcongs [oall_cong, oex_cong, OUN_cong];
|
|
109 |
|
9180
|
110 |
val major::prems = Goalw [lt_def, oall_def]
|
2469
|
111 |
"[| i<k; !!x.[| x<k; ALL y<x. P(y) |] ==> P(x) \
|
|
112 |
\ |] ==> P(i)";
|
|
113 |
by (rtac (major RS conjE) 1);
|
|
114 |
by (etac Ord_induct 1 THEN assume_tac 1);
|
4091
|
115 |
by (fast_tac (claset() addIs prems) 1);
|
2469
|
116 |
qed "lt_induct";
|