author | bulwahn |
Mon, 18 Jul 2011 10:34:21 +0200 | |
changeset 43888 | ee4be704c2a4 |
parent 32960 | 69916a850301 |
child 46820 | c656222c4dc1 |
permissions | -rw-r--r-- |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
26056
diff
changeset
|
1 |
(* Title: ZF/InfDatatype.thy |
13134 | 2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
3 |
Copyright 1994 University of Cambridge |
|
4 |
*) |
|
5 |
||
13356 | 6 |
header{*Infinite-Branching Datatype Definitions*} |
7 |
||
26056
6a0801279f4c
Made theory names in ZF disjoint from HOL theory names to allow loading both developments
krauss
parents:
16417
diff
changeset
|
8 |
theory InfDatatype imports Datatype_ZF Univ Finite Cardinal_AC begin |
13134 | 9 |
|
10 |
lemmas fun_Limit_VfromE = |
|
11 |
Limit_VfromE [OF apply_funtype InfCard_csucc [THEN InfCard_is_Limit]] |
|
12 |
||
13 |
lemma fun_Vcsucc_lemma: |
|
14 |
"[| f: D -> Vfrom(A,csucc(K)); |D| le K; InfCard(K) |] |
|
15 |
==> EX j. f: D -> Vfrom(A,j) & j < csucc(K)" |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
16 |
apply (rule_tac x = "\<Union>d\<in>D. LEAST i. f`d : Vfrom (A,i) " in exI) |
13134 | 17 |
apply (rule conjI) |
18 |
apply (rule_tac [2] le_UN_Ord_lt_csucc) |
|
13269 | 19 |
apply (rule_tac [4] ballI, erule_tac [4] fun_Limit_VfromE, simp_all) |
13134 | 20 |
prefer 2 apply (fast elim: Least_le [THEN lt_trans1] ltE) |
21 |
apply (rule Pi_type) |
|
22 |
apply (rename_tac [2] d) |
|
23 |
apply (erule_tac [2] fun_Limit_VfromE, simp_all) |
|
24 |
apply (subgoal_tac "f`d : Vfrom (A, LEAST i. f`d : Vfrom (A,i))") |
|
25 |
apply (erule Vfrom_mono [OF subset_refl UN_upper, THEN subsetD]) |
|
26 |
apply assumption |
|
27 |
apply (fast elim: LeastI ltE) |
|
28 |
done |
|
29 |
||
30 |
lemma subset_Vcsucc: |
|
31 |
"[| D <= Vfrom(A,csucc(K)); |D| le K; InfCard(K) |] |
|
32 |
==> EX j. D <= Vfrom(A,j) & j < csucc(K)" |
|
33 |
by (simp add: subset_iff_id fun_Vcsucc_lemma) |
|
34 |
||
35 |
(*Version for arbitrary index sets*) |
|
36 |
lemma fun_Vcsucc: |
|
37 |
"[| |D| le K; InfCard(K); D <= Vfrom(A,csucc(K)) |] ==> |
|
38 |
D -> Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))" |
|
39 |
apply (safe dest!: fun_Vcsucc_lemma subset_Vcsucc) |
|
40 |
apply (rule Vfrom [THEN ssubst]) |
|
41 |
apply (drule fun_is_rel) |
|
42 |
(*This level includes the function, and is below csucc(K)*) |
|
43 |
apply (rule_tac a1 = "succ (succ (j Un ja))" in UN_I [THEN UnI2]) |
|
44 |
apply (blast intro: ltD InfCard_csucc InfCard_is_Limit Limit_has_succ |
|
13269 | 45 |
Un_least_lt) |
13134 | 46 |
apply (erule subset_trans [THEN PowI]) |
47 |
apply (fast intro: Pair_in_Vfrom Vfrom_UnI1 Vfrom_UnI2) |
|
48 |
done |
|
49 |
||
50 |
lemma fun_in_Vcsucc: |
|
51 |
"[| f: D -> Vfrom(A, csucc(K)); |D| le K; InfCard(K); |
|
52 |
D <= Vfrom(A,csucc(K)) |] |
|
53 |
==> f: Vfrom(A,csucc(K))" |
|
54 |
by (blast intro: fun_Vcsucc [THEN subsetD]) |
|
55 |
||
56 |
(*Remove <= from the rule above*) |
|
57 |
lemmas fun_in_Vcsucc' = fun_in_Vcsucc [OF _ _ _ subsetI] |
|
58 |
||
59 |
(** Version where K itself is the index set **) |
|
60 |
||
61 |
lemma Card_fun_Vcsucc: |
|
62 |
"InfCard(K) ==> K -> Vfrom(A,csucc(K)) <= Vfrom(A,csucc(K))" |
|
63 |
apply (frule InfCard_is_Card [THEN Card_is_Ord]) |
|
64 |
apply (blast del: subsetI |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
26056
diff
changeset
|
65 |
intro: fun_Vcsucc Ord_cardinal_le i_subset_Vfrom |
13134 | 66 |
lt_csucc [THEN leI, THEN le_imp_subset, THEN subset_trans]) |
67 |
done |
|
68 |
||
69 |
lemma Card_fun_in_Vcsucc: |
|
70 |
"[| f: K -> Vfrom(A, csucc(K)); InfCard(K) |] ==> f: Vfrom(A,csucc(K))" |
|
71 |
by (blast intro: Card_fun_Vcsucc [THEN subsetD]) |
|
72 |
||
73 |
lemma Limit_csucc: "InfCard(K) ==> Limit(csucc(K))" |
|
74 |
by (erule InfCard_csucc [THEN InfCard_is_Limit]) |
|
75 |
||
76 |
lemmas Pair_in_Vcsucc = Pair_in_VLimit [OF _ _ Limit_csucc] |
|
77 |
lemmas Inl_in_Vcsucc = Inl_in_VLimit [OF _ Limit_csucc] |
|
78 |
lemmas Inr_in_Vcsucc = Inr_in_VLimit [OF _ Limit_csucc] |
|
79 |
lemmas zero_in_Vcsucc = Limit_csucc [THEN zero_in_VLimit] |
|
80 |
lemmas nat_into_Vcsucc = nat_into_VLimit [OF _ Limit_csucc] |
|
81 |
||
82 |
(*For handling Cardinals of the form (nat Un |X|) *) |
|
83 |
||
84 |
lemmas InfCard_nat_Un_cardinal = InfCard_Un [OF InfCard_nat Card_cardinal] |
|
85 |
||
86 |
lemmas le_nat_Un_cardinal = |
|
87 |
Un_upper2_le [OF Ord_nat Card_cardinal [THEN Card_is_Ord]] |
|
88 |
||
89 |
lemmas UN_upper_cardinal = UN_upper [THEN subset_imp_lepoll, THEN lepoll_imp_Card_le] |
|
90 |
||
91 |
(*The new version of Data_Arg.intrs, declared in Datatype.ML*) |
|
92 |
lemmas Data_Arg_intros = |
|
93 |
SigmaI InlI InrI |
|
94 |
Pair_in_univ Inl_in_univ Inr_in_univ |
|
95 |
zero_in_univ A_into_univ nat_into_univ UnCI |
|
96 |
||
97 |
(*For most K-branching datatypes with domain Vfrom(A, csucc(K)) *) |
|
98 |
lemmas inf_datatype_intros = |
|
99 |
InfCard_nat InfCard_nat_Un_cardinal |
|
100 |
Pair_in_Vcsucc Inl_in_Vcsucc Inr_in_Vcsucc |
|
101 |
zero_in_Vcsucc A_into_Vfrom nat_into_Vcsucc |
|
102 |
Card_fun_in_Vcsucc fun_in_Vcsucc' UN_I |
|
103 |
||
104 |
end |
|
105 |