author | paulson |
Thu, 20 Nov 1997 11:03:26 +0100 | |
changeset 4242 | 97601cf26262 |
parent 4091 | 771b1f6422a8 |
child 5067 | 62b6288e6005 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/InfDatatype.ML |
488 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
488 | 4 |
Copyright 1994 University of Cambridge |
5 |
||
801 | 6 |
Infinite-branching datatype definitions |
488 | 7 |
*) |
8 |
||
801 | 9 |
val fun_Limit_VfromE = |
3888 | 10 |
[apply_funtype, InfCard_csucc RS InfCard_is_Limit] MRS |
11 |
transfer InfDatatype.thy Limit_VfromE |
|
801 | 12 |
|> standard; |
488 | 13 |
|
14 |
goal InfDatatype.thy |
|
1461 | 15 |
"!!K. [| f: W -> Vfrom(A,csucc(K)); |W| le K; InfCard(K) \ |
517 | 16 |
\ |] ==> EX j. f: W -> Vfrom(A,j) & j < csucc(K)"; |
17 |
by (res_inst_tac [("x", "UN w:W. LEAST i. f`w : Vfrom(A,i)")] exI 1); |
|
1461 | 18 |
by (rtac conjI 1); |
19 |
by (rtac le_UN_Ord_lt_csucc 2); |
|
517 | 20 |
by (rtac ballI 4 THEN |
1461 | 21 |
etac fun_Limit_VfromE 4 THEN REPEAT_SOME assume_tac); |
4091 | 22 |
by (fast_tac (claset() addEs [Least_le RS lt_trans1, ltE]) 2); |
1461 | 23 |
by (rtac Pi_type 1); |
517 | 24 |
by (rename_tac "w" 2); |
1461 | 25 |
by (etac fun_Limit_VfromE 2 THEN REPEAT_SOME assume_tac); |
517 | 26 |
by (subgoal_tac "f`w : Vfrom(A, LEAST i. f`w : Vfrom(A,i))" 1); |
4091 | 27 |
by (fast_tac (claset() addEs [LeastI, ltE]) 2); |
516 | 28 |
by (eresolve_tac [[subset_refl, UN_upper] MRS Vfrom_mono RS subsetD] 1); |
29 |
by (assume_tac 1); |
|
760 | 30 |
qed "fun_Vcsucc_lemma"; |
516 | 31 |
|
32 |
goal InfDatatype.thy |
|
1461 | 33 |
"!!K. [| W <= Vfrom(A,csucc(K)); |W| le K; InfCard(K) \ |
517 | 34 |
\ |] ==> EX j. W <= Vfrom(A,j) & j < csucc(K)"; |
4091 | 35 |
by (asm_full_simp_tac (simpset() addsimps [subset_iff_id, fun_Vcsucc_lemma]) 1); |
760 | 36 |
qed "subset_Vcsucc"; |
488 | 37 |
|
517 | 38 |
(*Version for arbitrary index sets*) |
488 | 39 |
goal InfDatatype.thy |
534 | 40 |
"!!K. [| |W| le K; InfCard(K); W <= Vfrom(A,csucc(K)) |] ==> \ |
517 | 41 |
\ W -> Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))"; |
4091 | 42 |
by (safe_tac (claset() addSDs [fun_Vcsucc_lemma, subset_Vcsucc])); |
488 | 43 |
by (resolve_tac [Vfrom RS ssubst] 1); |
1461 | 44 |
by (dtac fun_is_rel 1); |
488 | 45 |
(*This level includes the function, and is below csucc(K)*) |
517 | 46 |
by (res_inst_tac [("a1", "succ(succ(j Un ja))")] (UN_I RS UnI2) 1); |
488 | 47 |
by (eresolve_tac [subset_trans RS PowI] 2); |
4091 | 48 |
by (fast_tac (claset() addIs [Pair_in_Vfrom, Vfrom_UnI1, Vfrom_UnI2]) 2); |
488 | 49 |
by (REPEAT (ares_tac [ltD, InfCard_csucc, InfCard_is_Limit, |
1461 | 50 |
Limit_has_succ, Un_least_lt] 1)); |
760 | 51 |
qed "fun_Vcsucc"; |
488 | 52 |
|
53 |
goal InfDatatype.thy |
|
1461 | 54 |
"!!K. [| f: W -> Vfrom(A, csucc(K)); |W| le K; InfCard(K); \ |
55 |
\ W <= Vfrom(A,csucc(K)) \ |
|
517 | 56 |
\ |] ==> f: Vfrom(A,csucc(K))"; |
57 |
by (REPEAT (ares_tac [fun_Vcsucc RS subsetD] 1)); |
|
760 | 58 |
qed "fun_in_Vcsucc"; |
517 | 59 |
|
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
60 |
(*Remove <= from the rule above*) |
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
61 |
val fun_in_Vcsucc' = subsetI RSN (4, fun_in_Vcsucc); |
517 | 62 |
|
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
63 |
(** Version where K itself is the index set **) |
517 | 64 |
|
65 |
goal InfDatatype.thy |
|
66 |
"!!K. InfCard(K) ==> K -> Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))"; |
|
67 |
by (forward_tac [InfCard_is_Card RS Card_is_Ord] 1); |
|
68 |
by (REPEAT (ares_tac [fun_Vcsucc, Ord_cardinal_le, |
|
1461 | 69 |
i_subset_Vfrom, |
70 |
lt_csucc RS leI RS le_imp_subset RS subset_trans] 1)); |
|
760 | 71 |
qed "Card_fun_Vcsucc"; |
517 | 72 |
|
73 |
goal InfDatatype.thy |
|
488 | 74 |
"!!K. [| f: K -> Vfrom(A, csucc(K)); InfCard(K) \ |
75 |
\ |] ==> f: Vfrom(A,csucc(K))"; |
|
517 | 76 |
by (REPEAT (ares_tac [Card_fun_Vcsucc RS subsetD] 1)); |
760 | 77 |
qed "Card_fun_in_Vcsucc"; |
488 | 78 |
|
801 | 79 |
(*Proved explicitly, in theory InfDatatype, to allow the bind_thm calls below*) |
80 |
qed_goal "Limit_csucc" InfDatatype.thy |
|
81 |
"!!K. InfCard(K) ==> Limit(csucc(K))" |
|
82 |
(fn _ => [etac (InfCard_csucc RS InfCard_is_Limit) 1]); |
|
83 |
||
84 |
bind_thm ("Pair_in_Vcsucc", Limit_csucc RSN (3, Pair_in_VLimit)); |
|
85 |
bind_thm ("Inl_in_Vcsucc", Limit_csucc RSN (2, Inl_in_VLimit)); |
|
86 |
bind_thm ("Inr_in_Vcsucc", Limit_csucc RSN (2, Inr_in_VLimit)); |
|
87 |
bind_thm ("zero_in_Vcsucc", Limit_csucc RS zero_in_VLimit); |
|
88 |
bind_thm ("nat_into_Vcsucc", Limit_csucc RSN (2, nat_into_VLimit)); |
|
488 | 89 |
|
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
90 |
(*For handling Cardinals of the form (nat Un |X|) *) |
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
91 |
|
801 | 92 |
bind_thm ("InfCard_nat_Un_cardinal", |
1461 | 93 |
[InfCard_nat, Card_cardinal] MRS InfCard_Un); |
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
94 |
|
801 | 95 |
bind_thm ("le_nat_Un_cardinal", |
1461 | 96 |
[Ord_nat, Card_cardinal RS Card_is_Ord] MRS Un_upper2_le); |
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
97 |
|
801 | 98 |
bind_thm ("UN_upper_cardinal", |
1461 | 99 |
UN_upper RS subset_imp_lepoll RS lepoll_imp_Card_le); |
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
100 |
|
488 | 101 |
(*For most K-branching datatypes with domain Vfrom(A, csucc(K)) *) |
102 |
val inf_datatype_intrs = |
|
524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
103 |
[InfCard_nat, InfCard_nat_Un_cardinal, |
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
104 |
Pair_in_Vcsucc, Inl_in_Vcsucc, Inr_in_Vcsucc, |
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
105 |
zero_in_Vcsucc, A_into_Vfrom, nat_into_Vcsucc, |
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset
|
106 |
Card_fun_in_Vcsucc, fun_in_Vcsucc', UN_I] @ datatype_intrs; |