| author | wenzelm | 
| Tue, 25 Mar 2025 23:05:15 +0100 | |
| changeset 82407 | fcc0f74ac086 | 
| parent 75624 | 22d1c5f2b9f4 | 
| permissions | -rw-r--r-- | 
| 58128 | 1  | 
(* Title: HOL/BNF_Composition.thy  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
2  | 
Author: Dmitriy Traytel, TU Muenchen  | 
| 57698 | 3  | 
Author: Jasmin Blanchette, TU Muenchen  | 
| 75624 | 4  | 
Author: Jan van Brügge, TU Muenchen  | 
5  | 
Copyright 2012, 2013, 2014, 2022  | 
|
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
6  | 
|
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
7  | 
Composition of bounded natural functors.  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
8  | 
*)  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
9  | 
|
| 60758 | 10  | 
section \<open>Composition of Bounded Natural Functors\<close>  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
11  | 
|
| 58128 | 12  | 
theory BNF_Composition  | 
| 55936 | 13  | 
imports BNF_Def  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
14  | 
begin  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
15  | 
|
| 
60918
 
4ceef1592e8c
new command for lifting BNF structure over typedefs
 
traytel 
parents: 
60758 
diff
changeset
 | 
16  | 
lemma ssubst_mem: "\<lbrakk>t = s; s \<in> X\<rbrakk> \<Longrightarrow> t \<in> X"  | 
| 
 
4ceef1592e8c
new command for lifting BNF structure over typedefs
 
traytel 
parents: 
60758 
diff
changeset
 | 
17  | 
by simp  | 
| 
 
4ceef1592e8c
new command for lifting BNF structure over typedefs
 
traytel 
parents: 
60758 
diff
changeset
 | 
18  | 
|
| 67091 | 19  | 
lemma empty_natural: "(\<lambda>_. {}) \<circ> f = image g \<circ> (\<lambda>_. {})"
 | 
| 58128 | 20  | 
by (rule ext) simp  | 
| 49312 | 21  | 
|
| 75624 | 22  | 
lemma Cinfinite_gt_empty: "Cinfinite r \<Longrightarrow> |{}| <o r"
 | 
23  | 
by (simp add: cinfinite_def finite_ordLess_infinite card_of_ordIso_finite Field_card_of card_of_well_order_on emptyI card_order_on_well_order_on)  | 
|
24  | 
||
| 67091 | 25  | 
lemma Union_natural: "Union \<circ> image (image f) = image f \<circ> Union"  | 
| 58128 | 26  | 
by (rule ext) (auto simp only: comp_apply)  | 
| 49312 | 27  | 
|
| 67091 | 28  | 
lemma in_Union_o_assoc: "x \<in> (Union \<circ> gset \<circ> gmap) A \<Longrightarrow> x \<in> (Union \<circ> (gset \<circ> gmap)) A"  | 
| 58128 | 29  | 
by (unfold comp_assoc)  | 
| 49312 | 30  | 
|
| 75624 | 31  | 
lemma regularCard_UNION_bound:  | 
32  | 
assumes "Cinfinite r" "regularCard r" and "|I| <o r" "\<And>i. i \<in> I \<Longrightarrow> |A i| <o r"  | 
|
33  | 
shows "|\<Union>i\<in>I. A i| <o r"  | 
|
34  | 
using assms cinfinite_def regularCard_stable stable_UNION by blast  | 
|
35  | 
||
36  | 
lemma comp_single_set_bd_strict:  | 
|
37  | 
assumes fbd: "Cinfinite fbd" "regularCard fbd" and  | 
|
38  | 
gbd: "Cinfinite gbd" "regularCard gbd" and  | 
|
39  | 
fset_bd: "\<And>x. |fset x| <o fbd" and  | 
|
40  | 
gset_bd: "\<And>x. |gset x| <o gbd"  | 
|
41  | 
shows "|\<Union>(fset ` gset x)| <o gbd *c fbd"  | 
|
42  | 
proof (cases "fbd <o gbd")  | 
|
43  | 
case True  | 
|
44  | 
then have "|fset x| <o gbd" for x using fset_bd ordLess_transitive by blast  | 
|
45  | 
then have "|\<Union>(fset ` gset x)| <o gbd" using regularCard_UNION_bound[OF gbd gset_bd] by blast  | 
|
46  | 
then have "|\<Union> (fset ` gset x)| <o fbd *c gbd"  | 
|
47  | 
using ordLess_ordLeq_trans ordLeq_cprod2 gbd(1) fbd(1) cinfinite_not_czero by blast  | 
|
48  | 
then show ?thesis using ordLess_ordIso_trans cprod_com by blast  | 
|
49  | 
next  | 
|
50  | 
case False  | 
|
51  | 
have "Well_order fbd" "Well_order gbd" using fbd(1) gbd(1) card_order_on_well_order_on by auto  | 
|
52  | 
then have "gbd \<le>o fbd" using not_ordLess_iff_ordLeq False by blast  | 
|
53  | 
then have "|gset x| <o fbd" for x using gset_bd ordLess_ordLeq_trans by blast  | 
|
54  | 
then have "|\<Union>(fset ` gset x)| <o fbd" using regularCard_UNION_bound[OF fbd] fset_bd by blast  | 
|
55  | 
then show ?thesis using ordLess_ordLeq_trans ordLeq_cprod2 gbd(1) fbd(1) cinfinite_not_czero by blast  | 
|
56  | 
qed  | 
|
57  | 
||
| 49312 | 58  | 
lemma comp_single_set_bd:  | 
59  | 
assumes fbd_Card_order: "Card_order fbd" and  | 
|
60  | 
fset_bd: "\<And>x. |fset x| \<le>o fbd" and  | 
|
61  | 
gset_bd: "\<And>x. |gset x| \<le>o gbd"  | 
|
| 
52141
 
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
 
haftmann 
parents: 
51893 
diff
changeset
 | 
62  | 
shows "|\<Union>(fset ` gset x)| \<le>o gbd *c fbd"  | 
| 58128 | 63  | 
apply simp  | 
64  | 
apply (rule ordLeq_transitive)  | 
|
65  | 
apply (rule card_of_UNION_Sigma)  | 
|
66  | 
apply (subst SIGMA_CSUM)  | 
|
67  | 
apply (rule ordLeq_transitive)  | 
|
68  | 
apply (rule card_of_Csum_Times')  | 
|
69  | 
apply (rule fbd_Card_order)  | 
|
70  | 
apply (rule ballI)  | 
|
71  | 
apply (rule fset_bd)  | 
|
72  | 
apply (rule ordLeq_transitive)  | 
|
73  | 
apply (rule cprod_mono1)  | 
|
74  | 
apply (rule gset_bd)  | 
|
75  | 
apply (rule ordIso_imp_ordLeq)  | 
|
76  | 
apply (rule ordIso_refl)  | 
|
77  | 
apply (rule Card_order_cprod)  | 
|
78  | 
done  | 
|
| 49312 | 79  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
80  | 
lemma csum_dup: "cinfinite r \<Longrightarrow> Card_order r \<Longrightarrow> p +c p' =o r +c r \<Longrightarrow> p +c p' =o r"  | 
| 58128 | 81  | 
apply (erule ordIso_transitive)  | 
82  | 
apply (frule csum_absorb2')  | 
|
83  | 
apply (erule ordLeq_refl)  | 
|
84  | 
by simp  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
85  | 
|
| 
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
86  | 
lemma cprod_dup: "cinfinite r \<Longrightarrow> Card_order r \<Longrightarrow> p *c p' =o r *c r \<Longrightarrow> p *c p' =o r"  | 
| 58128 | 87  | 
apply (erule ordIso_transitive)  | 
88  | 
apply (rule cprod_infinite)  | 
|
89  | 
by simp  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
90  | 
|
| 
52141
 
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
 
haftmann 
parents: 
51893 
diff
changeset
 | 
91  | 
lemma Union_image_insert: "\<Union>(f ` insert a B) = f a \<union> \<Union>(f ` B)"  | 
| 58128 | 92  | 
by simp  | 
| 49312 | 93  | 
|
| 
52141
 
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
 
haftmann 
parents: 
51893 
diff
changeset
 | 
94  | 
lemma Union_image_empty: "A \<union> \<Union>(f ` {}) = A"
 | 
| 58128 | 95  | 
by simp  | 
| 49312 | 96  | 
|
| 67091 | 97  | 
lemma image_o_collect: "collect ((\<lambda>f. image g \<circ> f) ` F) = image g \<circ> collect F"  | 
| 58128 | 98  | 
by (rule ext) (auto simp add: collect_def)  | 
| 49312 | 99  | 
|
100  | 
lemma conj_subset_def: "A \<subseteq> {x. P x \<and> Q x} = (A \<subseteq> {x. P x} \<and> A \<subseteq> {x. Q x})"
 | 
|
| 58128 | 101  | 
by blast  | 
| 49312 | 102  | 
|
| 
52141
 
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
 
haftmann 
parents: 
51893 
diff
changeset
 | 
103  | 
lemma UN_image_subset: "\<Union>(f ` g x) \<subseteq> X = (g x \<subseteq> {x. f x \<subseteq> X})"
 | 
| 58128 | 104  | 
by blast  | 
| 49312 | 105  | 
|
| 69745 | 106  | 
lemma comp_set_bd_Union_o_collect: "|\<Union>(\<Union>((\<lambda>f. f x) ` X))| \<le>o hbd \<Longrightarrow> |(Union \<circ> collect X) x| \<le>o hbd"  | 
| 58128 | 107  | 
by (unfold comp_apply collect_def) simp  | 
| 49312 | 108  | 
|
| 75624 | 109  | 
lemma comp_set_bd_Union_o_collect_strict: "|\<Union>(\<Union>((\<lambda>f. f x) ` X))| <o hbd \<Longrightarrow> |(Union \<circ> collect X) x| <o hbd"  | 
110  | 
by (unfold comp_apply collect_def) simp  | 
|
111  | 
||
| 62324 | 112  | 
lemma Collect_inj: "Collect P = Collect Q \<Longrightarrow> P = Q"  | 
113  | 
by blast  | 
|
114  | 
||
| 67613 | 115  | 
lemma Grp_fst_snd: "(Grp (Collect (case_prod R)) fst)\<inverse>\<inverse> OO Grp (Collect (case_prod R)) snd = R"  | 
| 58128 | 116  | 
unfolding Grp_def fun_eq_iff relcompp.simps by auto  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
49512 
diff
changeset
 | 
117  | 
|
| 67613 | 118  | 
lemma OO_Grp_cong: "A = B \<Longrightarrow> (Grp A f)\<inverse>\<inverse> OO Grp A g = (Grp B f)\<inverse>\<inverse> OO Grp B g"  | 
| 58128 | 119  | 
by (rule arg_cong)  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
49512 
diff
changeset
 | 
120  | 
|
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
121  | 
lemma vimage2p_relcompp_mono: "R OO S \<le> T \<Longrightarrow>  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
122  | 
vimage2p f g R OO vimage2p g h S \<le> vimage2p f h T"  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
123  | 
unfolding vimage2p_def by auto  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
124  | 
|
| 67091 | 125  | 
lemma type_copy_map_cong0: "M (g x) = N (h x) \<Longrightarrow> (f \<circ> M \<circ> g) x = (f \<circ> N \<circ> h) x"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
126  | 
by auto  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
127  | 
|
| 75624 | 128  | 
lemma type_copy_set_bd: "(\<And>y. |S y| <o bd) \<Longrightarrow> |(S \<circ> Rep) x| <o bd"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
129  | 
by auto  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
130  | 
|
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
131  | 
lemma vimage2p_cong: "R = S \<Longrightarrow> vimage2p f g R = vimage2p f g S"  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
132  | 
by simp  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
133  | 
|
| 67091 | 134  | 
lemma Ball_comp_iff: "(\<lambda>x. Ball (A x) f) \<circ> g = (\<lambda>x. Ball ((A \<circ> g) x) f)"  | 
| 62324 | 135  | 
unfolding o_def by auto  | 
136  | 
||
| 67091 | 137  | 
lemma conj_comp_iff: "(\<lambda>x. P x \<and> Q x) \<circ> g = (\<lambda>x. (P \<circ> g) x \<and> (Q \<circ> g) x)"  | 
| 62324 | 138  | 
unfolding o_def by auto  | 
139  | 
||
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
140  | 
context  | 
| 58128 | 141  | 
fixes Rep Abs  | 
142  | 
assumes type_copy: "type_definition Rep Abs UNIV"  | 
|
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
143  | 
begin  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
144  | 
|
| 67091 | 145  | 
lemma type_copy_map_id0: "M = id \<Longrightarrow> Abs \<circ> M \<circ> Rep = id"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
146  | 
using type_definition.Rep_inverse[OF type_copy] by auto  | 
| 55811 | 147  | 
|
| 67091 | 148  | 
lemma type_copy_map_comp0: "M = M1 \<circ> M2 \<Longrightarrow> f \<circ> M \<circ> g = (f \<circ> M1 \<circ> Rep) \<circ> (Abs \<circ> M2 \<circ> g)"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
149  | 
using type_definition.Abs_inverse[OF type_copy UNIV_I] by auto  | 
| 55811 | 150  | 
|
| 67091 | 151  | 
lemma type_copy_set_map0: "S \<circ> M = image f \<circ> S' \<Longrightarrow> (S \<circ> Rep) \<circ> (Abs \<circ> M \<circ> g) = image f \<circ> (S' \<circ> g)"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
152  | 
using type_definition.Abs_inverse[OF type_copy UNIV_I] by (auto simp: o_def fun_eq_iff)  | 
| 55811 | 153  | 
|
| 67091 | 154  | 
lemma type_copy_wit: "x \<in> (S \<circ> Rep) (Abs y) \<Longrightarrow> x \<in> S y"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
155  | 
using type_definition.Abs_inverse[OF type_copy UNIV_I] by auto  | 
| 55811 | 156  | 
|
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
157  | 
lemma type_copy_vimage2p_Grp_Rep: "vimage2p f Rep (Grp (Collect P) h) =  | 
| 67091 | 158  | 
Grp (Collect (\<lambda>x. P (f x))) (Abs \<circ> h \<circ> f)"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
159  | 
unfolding vimage2p_def Grp_def fun_eq_iff  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
160  | 
by (auto simp: type_definition.Abs_inverse[OF type_copy UNIV_I]  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
161  | 
type_definition.Rep_inverse[OF type_copy] dest: sym)  | 
| 55811 | 162  | 
|
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
163  | 
lemma type_copy_vimage2p_Grp_Abs:  | 
| 67091 | 164  | 
"\<And>h. vimage2p g Abs (Grp (Collect P) h) = Grp (Collect (\<lambda>x. P (g x))) (Rep \<circ> h \<circ> g)"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
165  | 
unfolding vimage2p_def Grp_def fun_eq_iff  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
166  | 
by (auto simp: type_definition.Abs_inverse[OF type_copy UNIV_I]  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
167  | 
type_definition.Rep_inverse[OF type_copy] dest: sym)  | 
| 55811 | 168  | 
|
169  | 
lemma type_copy_ex_RepI: "(\<exists>b. F b) = (\<exists>b. F (Rep b))"  | 
|
170  | 
proof safe  | 
|
171  | 
fix b assume "F b"  | 
|
172  | 
show "\<exists>b'. F (Rep b')"  | 
|
173  | 
proof (rule exI)  | 
|
| 60758 | 174  | 
from \<open>F b\<close> show "F (Rep (Abs b))" using type_definition.Abs_inverse[OF type_copy] by auto  | 
| 55811 | 175  | 
qed  | 
176  | 
qed blast  | 
|
177  | 
||
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
178  | 
lemma vimage2p_relcompp_converse:  | 
| 67613 | 179  | 
"vimage2p f g (R\<inverse>\<inverse> OO S) = (vimage2p Rep f R)\<inverse>\<inverse> OO vimage2p Rep g S"  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
180  | 
unfolding vimage2p_def relcompp.simps conversep.simps fun_eq_iff image_def  | 
| 55811 | 181  | 
by (auto simp: type_copy_ex_RepI)  | 
| 
55803
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
182  | 
|
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
183  | 
end  | 
| 
 
74d3fe9031d8
joint work with blanchet: intermediate typedef for the input to fp-operations
 
traytel 
parents: 
55705 
diff
changeset
 | 
184  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
185  | 
bnf DEADID: 'a  | 
| 
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
186  | 
map: "id :: 'a \<Rightarrow> 'a"  | 
| 
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
187  | 
bd: natLeq  | 
| 67399 | 188  | 
rel: "(=) :: 'a \<Rightarrow> 'a \<Rightarrow> bool"  | 
| 75624 | 189  | 
by (auto simp add: natLeq_card_order natLeq_cinfinite regularCard_natLeq)  | 
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
190  | 
|
| 58353 | 191  | 
definition id_bnf :: "'a \<Rightarrow> 'a" where  | 
192  | 
"id_bnf \<equiv> (\<lambda>x. x)"  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
193  | 
|
| 58181 | 194  | 
lemma id_bnf_apply: "id_bnf x = x"  | 
195  | 
unfolding id_bnf_def by simp  | 
|
| 
56016
 
8875cdcfc85b
unfold intermediate definitions after sealing the bnf
 
traytel 
parents: 
55936 
diff
changeset
 | 
196  | 
|
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
197  | 
bnf ID: 'a  | 
| 58181 | 198  | 
  map: "id_bnf :: ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"
 | 
| 
55935
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
199  | 
  sets: "\<lambda>x. {x}"
 | 
| 
 
8f20d09d294e
move special BNFs used for composition only to BNF_Comp;
 
traytel 
parents: 
55930 
diff
changeset
 | 
200  | 
bd: natLeq  | 
| 58181 | 201  | 
  rel: "id_bnf :: ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool"
 | 
| 62324 | 202  | 
  pred: "id_bnf :: ('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool"
 | 
| 58181 | 203  | 
unfolding id_bnf_def  | 
| 75624 | 204  | 
apply (auto simp: Grp_def fun_eq_iff relcompp.simps natLeq_card_order natLeq_cinfinite regularCard_natLeq)  | 
205  | 
apply (rule finite_ordLess_infinite[OF _ natLeq_Well_order])  | 
|
| 58128 | 206  | 
apply (auto simp add: Field_card_of Field_natLeq card_of_well_order_on)[3]  | 
207  | 
done  | 
|
| 
55854
 
ee270328a781
make 'typedef' optional, depending on size of original type
 
blanchet 
parents: 
55851 
diff
changeset
 | 
208  | 
|
| 58181 | 209  | 
lemma type_definition_id_bnf_UNIV: "type_definition id_bnf id_bnf UNIV"  | 
210  | 
unfolding id_bnf_def by unfold_locales auto  | 
|
| 
55854
 
ee270328a781
make 'typedef' optional, depending on size of original type
 
blanchet 
parents: 
55851 
diff
changeset
 | 
211  | 
|
| 69605 | 212  | 
ML_file \<open>Tools/BNF/bnf_comp_tactics.ML\<close>  | 
213  | 
ML_file \<open>Tools/BNF/bnf_comp.ML\<close>  | 
|
| 
49309
 
f20b24214ac2
split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
 
blanchet 
parents: 
49308 
diff
changeset
 | 
214  | 
|
| 58282 | 215  | 
hide_fact  | 
216  | 
DEADID.inj_map DEADID.inj_map_strong DEADID.map_comp DEADID.map_cong DEADID.map_cong0  | 
|
217  | 
DEADID.map_cong_simp DEADID.map_id DEADID.map_id0 DEADID.map_ident DEADID.map_transfer  | 
|
218  | 
DEADID.rel_Grp DEADID.rel_compp DEADID.rel_compp_Grp DEADID.rel_conversep DEADID.rel_eq  | 
|
219  | 
DEADID.rel_flip DEADID.rel_map DEADID.rel_mono DEADID.rel_transfer  | 
|
220  | 
ID.inj_map ID.inj_map_strong ID.map_comp ID.map_cong ID.map_cong0 ID.map_cong_simp ID.map_id  | 
|
221  | 
ID.map_id0 ID.map_ident ID.map_transfer ID.rel_Grp ID.rel_compp ID.rel_compp_Grp ID.rel_conversep  | 
|
222  | 
ID.rel_eq ID.rel_flip ID.rel_map ID.rel_mono ID.rel_transfer ID.set_map ID.set_transfer  | 
|
223  | 
||
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
224  | 
end  |