author  lcp 
Mon, 15 Aug 1994 18:15:09 +0200  
changeset 524  b1bf18e83302 
parent 517  a9f93400f307 
child 534  cd8bec47e175 
permissions  rwrr 
488  1 
(* Title: ZF/InfDatatype.ML 
2 
ID: $Id$ 

3 
Author: Lawrence C Paulson, Cambridge University Computer Laboratory 

4 
Copyright 1994 University of Cambridge 

5 

516  6 
Datatype Definitions involving > 
7 
Even infinitebranching! 

488  8 
*) 
9 

516  10 
(*** Closure under finite powerset ***) 
11 

12 
val Fin_Univ_thy = merge_theories (Univ.thy,Finite.thy); 

13 

14 
goal Fin_Univ_thy 

15 
"!!i. [ b: Fin(Vfrom(A,i)); Limit(i) ] ==> EX j. b <= Vfrom(A,j) & j<i"; 

16 
by (eresolve_tac [Fin_induct] 1); 

17 
by (fast_tac (ZF_cs addSDs [Limit_has_0]) 1); 

18 
by (safe_tac ZF_cs); 

19 
by (eresolve_tac [Limit_VfromE] 1); 

20 
by (assume_tac 1); 

21 
by (res_inst_tac [("x", "xa Un j")] exI 1); 

22 
by (best_tac (ZF_cs addIs [subset_refl RS Vfrom_mono RS subsetD, 

23 
Un_least_lt]) 1); 

24 
val Fin_Vfrom_lemma = result(); 

25 

26 
goal Fin_Univ_thy "!!i. Limit(i) ==> Fin(Vfrom(A,i)) <= Vfrom(A,i)"; 

27 
by (rtac subsetI 1); 

28 
by (dresolve_tac [Fin_Vfrom_lemma] 1); 

29 
by (safe_tac ZF_cs); 

30 
by (resolve_tac [Vfrom RS ssubst] 1); 

31 
by (fast_tac (ZF_cs addSDs [ltD]) 1); 

32 
val Fin_VLimit = result(); 

33 

34 
val Fin_subset_VLimit = 

35 
[Fin_mono, Fin_VLimit] MRS subset_trans > standard; 

36 

37 
goal Fin_Univ_thy 

38 
"!!i. [ n: nat; Limit(i) ] ==> n > Vfrom(A,i) <= Vfrom(A,i)"; 

39 
by (eresolve_tac [nat_fun_subset_Fin RS subset_trans] 1); 

40 
by (REPEAT (ares_tac [Fin_subset_VLimit, Sigma_subset_VLimit, 

41 
nat_subset_VLimit, subset_refl] 1)); 

42 
val nat_fun_VLimit = result(); 

43 

44 
val nat_fun_subset_VLimit = 

45 
[Pi_mono, nat_fun_VLimit] MRS subset_trans > standard; 

46 

47 

48 
goalw Fin_Univ_thy [univ_def] "Fin(univ(A)) <= univ(A)"; 

49 
by (rtac (Limit_nat RS Fin_VLimit) 1); 

50 
val Fin_univ = result(); 

51 

52 
val Fin_subset_univ = [Fin_mono, Fin_univ] MRS subset_trans > standard; 

53 

54 
goalw Fin_Univ_thy [univ_def] "!!i. n: nat ==> n > univ(A) <= univ(A)"; 

55 
by (etac (Limit_nat RSN (2,nat_fun_VLimit)) 1); 

56 
val nat_fun_univ = result(); 

57 

58 

59 
(*** Infinite branching ***) 

60 

488  61 
val fun_Limit_VfromE = 
62 
[apply_funtype, InfCard_csucc RS InfCard_is_Limit] MRS Limit_VfromE 

63 
> standard; 

64 

65 
goal InfDatatype.thy 

517  66 
"!!K. [ f: W > Vfrom(A,csucc(K)); W le K; InfCard(K) \ 
67 
\ ] ==> EX j. f: W > Vfrom(A,j) & j < csucc(K)"; 

68 
by (res_inst_tac [("x", "UN w:W. LEAST i. f`w : Vfrom(A,i)")] exI 1); 

516  69 
by (resolve_tac [conjI] 1); 
517  70 
by (resolve_tac [le_UN_Ord_lt_csucc] 2); 
71 
by (rtac ballI 4 THEN 

72 
eresolve_tac [fun_Limit_VfromE] 4 THEN REPEAT_SOME assume_tac); 

516  73 
by (fast_tac (ZF_cs addEs [Least_le RS lt_trans1, ltE]) 2); 
74 
by (resolve_tac [Pi_type] 1); 

517  75 
by (rename_tac "w" 2); 
516  76 
by (eresolve_tac [fun_Limit_VfromE] 2 THEN REPEAT_SOME assume_tac); 
517  77 
by (subgoal_tac "f`w : Vfrom(A, LEAST i. f`w : Vfrom(A,i))" 1); 
516  78 
by (fast_tac (ZF_cs addEs [LeastI, ltE]) 2); 
79 
by (eresolve_tac [[subset_refl, UN_upper] MRS Vfrom_mono RS subsetD] 1); 

80 
by (assume_tac 1); 

81 
val fun_Vcsucc_lemma = result(); 

82 

83 
goal InfDatatype.thy 

517  84 
"!!K. [ W <= Vfrom(A,csucc(K)); W le K; InfCard(K) \ 
85 
\ ] ==> EX j. W <= Vfrom(A,j) & j < csucc(K)"; 

86 
by (asm_full_simp_tac (ZF_ss addsimps [subset_iff_id, fun_Vcsucc_lemma]) 1); 

87 
val subset_Vcsucc = result(); 

488  88 

517  89 
(*Version for arbitrary index sets*) 
488  90 
goal InfDatatype.thy 
517  91 
"!!K. [ W le K; W <= Vfrom(A,csucc(K)); InfCard(K) ] ==> \ 
92 
\ W > Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))"; 

93 
by (safe_tac (ZF_cs addSDs [fun_Vcsucc_lemma, subset_Vcsucc])); 

488  94 
by (resolve_tac [Vfrom RS ssubst] 1); 
95 
by (eresolve_tac [PiE] 1); 

96 
(*This level includes the function, and is below csucc(K)*) 

517  97 
by (res_inst_tac [("a1", "succ(succ(j Un ja))")] (UN_I RS UnI2) 1); 
488  98 
by (eresolve_tac [subset_trans RS PowI] 2); 
517  99 
by (fast_tac (ZF_cs addIs [Pair_in_Vfrom, Vfrom_UnI1, Vfrom_UnI2]) 2); 
488  100 
by (REPEAT (ares_tac [ltD, InfCard_csucc, InfCard_is_Limit, 
101 
Limit_has_succ, Un_least_lt] 1)); 

516  102 
val fun_Vcsucc = result(); 
488  103 

104 
goal InfDatatype.thy 

517  105 
"!!K. [ f: W > Vfrom(A, csucc(K)); W le K; InfCard(K); \ 
106 
\ W <= Vfrom(A,csucc(K)) \ 

107 
\ ] ==> f: Vfrom(A,csucc(K))"; 

108 
by (REPEAT (ares_tac [fun_Vcsucc RS subsetD] 1)); 

109 
val fun_in_Vcsucc = result(); 

110 

524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

111 
(*Remove <= from the rule above*) 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

112 
val fun_in_Vcsucc' = subsetI RSN (4, fun_in_Vcsucc); 
517  113 

524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

114 
(** Version where K itself is the index set **) 
517  115 

116 
goal InfDatatype.thy 

117 
"!!K. InfCard(K) ==> K > Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))"; 

118 
by (forward_tac [InfCard_is_Card RS Card_is_Ord] 1); 

119 
by (REPEAT (ares_tac [fun_Vcsucc, Ord_cardinal_le, 

120 
i_subset_Vfrom, 

121 
lt_csucc RS leI RS le_imp_subset RS subset_trans] 1)); 

122 
val Card_fun_Vcsucc = result(); 

123 

124 
goal InfDatatype.thy 

488  125 
"!!K. [ f: K > Vfrom(A, csucc(K)); InfCard(K) \ 
126 
\ ] ==> f: Vfrom(A,csucc(K))"; 

517  127 
by (REPEAT (ares_tac [Card_fun_Vcsucc RS subsetD] 1)); 
128 
val Card_fun_in_Vcsucc = result(); 

488  129 

516  130 
val Pair_in_Vcsucc = Limit_csucc RSN (3, Pair_in_VLimit) > standard; 
131 
val Inl_in_Vcsucc = Limit_csucc RSN (2, Inl_in_VLimit) > standard; 

132 
val Inr_in_Vcsucc = Limit_csucc RSN (2, Inr_in_VLimit) > standard; 

133 
val zero_in_Vcsucc = Limit_csucc RS zero_in_VLimit > standard; 

134 
val nat_into_Vcsucc = Limit_csucc RSN (2, nat_into_VLimit) > standard; 

488  135 

524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

136 
(*For handling Cardinals of the form (nat Un X) *) 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

137 

b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

138 
val InfCard_nat_Un_cardinal = [InfCard_nat, Card_cardinal] MRS InfCard_Un 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

139 
> standard; 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

140 

b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

141 
val le_nat_Un_cardinal = 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

142 
[Ord_nat, Card_cardinal RS Card_is_Ord] MRS Un_upper2_le > standard; 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

143 

b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

144 
val UN_upper_cardinal = UN_upper RS subset_imp_lepoll RS lepoll_imp_le 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

145 
> standard; 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

146 

488  147 
(*For most Kbranching datatypes with domain Vfrom(A, csucc(K)) *) 
148 
val inf_datatype_intrs = 

524
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

149 
[InfCard_nat, InfCard_nat_Un_cardinal, 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

150 
Pair_in_Vcsucc, Inl_in_Vcsucc, Inr_in_Vcsucc, 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

151 
zero_in_Vcsucc, A_into_Vfrom, nat_into_Vcsucc, 
b1bf18e83302
ZF/InfDatatype: simplified, extended results for infinite branching
lcp
parents:
517
diff
changeset

152 
Card_fun_in_Vcsucc, fun_in_Vcsucc', UN_I] @ datatype_intrs; 