| author | blanchet | 
| Sat, 12 Jul 2014 11:31:22 +0200 | |
| changeset 57546 | 2b561e7a0512 | 
| parent 57398 | 882091eb1e9a | 
| child 57641 | dc59f147b27d | 
| permissions | -rw-r--r-- | 
| 55059 | 1  | 
(* Title: HOL/BNF_Def.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  | 
| 57398 | 3  | 
Author: Jasmin Blanchette, TU Muenchen  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
4  | 
Copyright 2012  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
5  | 
|
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
6  | 
Definition of bounded natural functors.  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
7  | 
*)  | 
| 
 
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  | 
header {* Definition of Bounded Natural Functors *}
 | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
10  | 
|
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
11  | 
theory BNF_Def  | 
| 57398 | 12  | 
imports BNF_Cardinal_Arithmetic Fun_Def_Base  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
13  | 
keywords  | 
| 49286 | 14  | 
"print_bnfs" :: diag and  | 
| 
51836
 
4d6dcd51dd52
renamed "bnf_def" keyword to "bnf" (since it's not a definition, but rather a registration)
 
blanchet 
parents: 
49537 
diff
changeset
 | 
15  | 
"bnf" :: thy_goal  | 
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
16  | 
begin  | 
| 
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
17  | 
|
| 57398 | 18  | 
definition  | 
19  | 
  rel_fun :: "('a \<Rightarrow> 'c \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'd \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('c \<Rightarrow> 'd) \<Rightarrow> bool"
 | 
|
20  | 
where  | 
|
21  | 
"rel_fun A B = (\<lambda>f g. \<forall>x y. A x y \<longrightarrow> B (f x) (g y))"  | 
|
22  | 
||
23  | 
lemma rel_funI [intro]:  | 
|
24  | 
assumes "\<And>x y. A x y \<Longrightarrow> B (f x) (g y)"  | 
|
25  | 
shows "rel_fun A B f g"  | 
|
26  | 
using assms by (simp add: rel_fun_def)  | 
|
27  | 
||
28  | 
lemma rel_funD:  | 
|
29  | 
assumes "rel_fun A B f g" and "A x y"  | 
|
30  | 
shows "B (f x) (g y)"  | 
|
31  | 
using assms by (simp add: rel_fun_def)  | 
|
32  | 
||
33  | 
definition collect where  | 
|
34  | 
"collect F x = (\<Union>f \<in> F. f x)"  | 
|
35  | 
||
36  | 
lemma fstI: "x = (y, z) \<Longrightarrow> fst x = y"  | 
|
37  | 
by simp  | 
|
38  | 
||
39  | 
lemma sndI: "x = (y, z) \<Longrightarrow> snd x = z"  | 
|
40  | 
by simp  | 
|
41  | 
||
42  | 
lemma bijI': "\<lbrakk>\<And>x y. (f x = f y) = (x = y); \<And>y. \<exists>x. y = f x\<rbrakk> \<Longrightarrow> bij f"  | 
|
43  | 
unfolding bij_def inj_on_def by auto blast  | 
|
44  | 
||
45  | 
(* Operator: *)  | 
|
46  | 
definition "Gr A f = {(a, f a) | a. a \<in> A}"
 | 
|
47  | 
||
48  | 
definition "Grp A f = (\<lambda>a b. b = f a \<and> a \<in> A)"  | 
|
49  | 
||
50  | 
definition vimage2p where  | 
|
51  | 
"vimage2p f g R = (\<lambda>x y. R (f x) (g y))"  | 
|
52  | 
||
| 56635 | 53  | 
lemma collect_comp: "collect F \<circ> g = collect ((\<lambda>f. f \<circ> g) ` F)"  | 
| 55066 | 54  | 
by (rule ext) (auto simp only: comp_apply collect_def)  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
55  | 
|
| 49495 | 56  | 
definition convol ("<_ , _>") where
 | 
57  | 
"<f , g> \<equiv> %a. (f a, g a)"  | 
|
58  | 
||
59  | 
lemma fst_convol:  | 
|
| 56635 | 60  | 
"fst \<circ> <f , g> = f"  | 
| 49495 | 61  | 
apply(rule ext)  | 
62  | 
unfolding convol_def by simp  | 
|
63  | 
||
64  | 
lemma snd_convol:  | 
|
| 56635 | 65  | 
"snd \<circ> <f , g> = g"  | 
| 49495 | 66  | 
apply(rule ext)  | 
67  | 
unfolding convol_def by simp  | 
|
68  | 
||
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
69  | 
lemma convol_mem_GrpI:  | 
| 
52986
 
7f7bbeb16538
eliminated bogus assumption from theorem (that was instantiated with refl and resulted in flexflex pairs)
 
traytel 
parents: 
52749 
diff
changeset
 | 
70  | 
"x \<in> A \<Longrightarrow> <id , g> x \<in> (Collect (split (Grp A g)))"  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
71  | 
unfolding convol_def Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
72  | 
|
| 49312 | 73  | 
definition csquare where  | 
74  | 
"csquare A f1 f2 p1 p2 \<longleftrightarrow> (\<forall> a \<in> A. f1 (p1 a) = f2 (p2 a))"  | 
|
75  | 
||
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
76  | 
lemma eq_alt: "op = = Grp UNIV id"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
77  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
78  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
79  | 
lemma leq_conversepI: "R = op = \<Longrightarrow> R \<le> R^--1"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
80  | 
by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
81  | 
|
| 
54841
 
af71b753c459
express weak pullback property of bnfs only in terms of the relator
 
traytel 
parents: 
54581 
diff
changeset
 | 
82  | 
lemma leq_OOI: "R = op = \<Longrightarrow> R \<le> R OO R"  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
83  | 
by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
84  | 
|
| 53561 | 85  | 
lemma OO_Grp_alt: "(Grp A f)^--1 OO Grp A g = (\<lambda>x y. \<exists>z. z \<in> A \<and> f z = x \<and> g z = y)"  | 
86  | 
unfolding Grp_def by auto  | 
|
87  | 
||
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
88  | 
lemma Grp_UNIV_id: "f = id \<Longrightarrow> (Grp UNIV f)^--1 OO Grp UNIV f = Grp UNIV f"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
89  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
90  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
91  | 
lemma Grp_UNIV_idI: "x = y \<Longrightarrow> Grp UNIV id x y"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
92  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
93  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
94  | 
lemma Grp_mono: "A \<le> B \<Longrightarrow> Grp A f \<le> Grp B f"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
95  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
96  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
97  | 
lemma GrpI: "\<lbrakk>f x = y; x \<in> A\<rbrakk> \<Longrightarrow> Grp A f x y"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
98  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
99  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
100  | 
lemma GrpE: "Grp A f x y \<Longrightarrow> (\<lbrakk>f x = y; x \<in> A\<rbrakk> \<Longrightarrow> R) \<Longrightarrow> R"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
101  | 
unfolding Grp_def by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
102  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
103  | 
lemma Collect_split_Grp_eqD: "z \<in> Collect (split (Grp A f)) \<Longrightarrow> (f \<circ> fst) z = snd z"  | 
| 55066 | 104  | 
unfolding Grp_def comp_def by auto  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
105  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
106  | 
lemma Collect_split_Grp_inD: "z \<in> Collect (split (Grp A f)) \<Longrightarrow> fst z \<in> A"  | 
| 55066 | 107  | 
unfolding Grp_def comp_def by auto  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
108  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
109  | 
definition "pick_middlep P Q a c = (SOME b. P a b \<and> Q b c)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
110  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
111  | 
lemma pick_middlep:  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
112  | 
"(P OO Q) a c \<Longrightarrow> P a (pick_middlep P Q a c) \<and> Q (pick_middlep P Q a c) c"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
113  | 
unfolding pick_middlep_def apply(rule someI_ex) by auto  | 
| 49312 | 114  | 
|
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
115  | 
definition fstOp where "fstOp P Q ac = (fst ac, pick_middlep P Q (fst ac) (snd ac))"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
116  | 
definition sndOp where "sndOp P Q ac = (pick_middlep P Q (fst ac) (snd ac), (snd ac))"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
117  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
118  | 
lemma fstOp_in: "ac \<in> Collect (split (P OO Q)) \<Longrightarrow> fstOp P Q ac \<in> Collect (split P)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
119  | 
unfolding fstOp_def mem_Collect_eq  | 
| 
55642
 
63beb38e9258
adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
 
blanchet 
parents: 
55414 
diff
changeset
 | 
120  | 
by (subst (asm) surjective_pairing, unfold prod.case) (erule pick_middlep[THEN conjunct1])  | 
| 49312 | 121  | 
|
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
122  | 
lemma fst_fstOp: "fst bc = (fst \<circ> fstOp P Q) bc"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
123  | 
unfolding comp_def fstOp_def by simp  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
124  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
125  | 
lemma snd_sndOp: "snd bc = (snd \<circ> sndOp P Q) bc"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
126  | 
unfolding comp_def sndOp_def by simp  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
127  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
128  | 
lemma sndOp_in: "ac \<in> Collect (split (P OO Q)) \<Longrightarrow> sndOp P Q ac \<in> Collect (split Q)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
129  | 
unfolding sndOp_def mem_Collect_eq  | 
| 
55642
 
63beb38e9258
adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
 
blanchet 
parents: 
55414 
diff
changeset
 | 
130  | 
by (subst (asm) surjective_pairing, unfold prod.case) (erule pick_middlep[THEN conjunct2])  | 
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
131  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
132  | 
lemma csquare_fstOp_sndOp:  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
133  | 
"csquare (Collect (split (P OO Q))) snd fst (fstOp P Q) (sndOp P Q)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
134  | 
unfolding csquare_def fstOp_def sndOp_def using pick_middlep by simp  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
135  | 
|
| 56635 | 136  | 
lemma snd_fst_flip: "snd xy = (fst \<circ> (%(x, y). (y, x))) xy"  | 
| 49312 | 137  | 
by (simp split: prod.split)  | 
138  | 
||
| 56635 | 139  | 
lemma fst_snd_flip: "fst xy = (snd \<circ> (%(x, y). (y, x))) xy"  | 
| 49312 | 140  | 
by (simp split: prod.split)  | 
141  | 
||
| 
51893
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
142  | 
lemma flip_pred: "A \<subseteq> Collect (split (R ^--1)) \<Longrightarrow> (%(x, y). (y, x)) ` A \<subseteq> Collect (split R)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
143  | 
by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
144  | 
|
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
145  | 
lemma Collect_split_mono: "A \<le> B \<Longrightarrow> Collect (split A) \<subseteq> Collect (split B)"  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
146  | 
by auto  | 
| 
 
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
 
traytel 
parents: 
51836 
diff
changeset
 | 
147  | 
|
| 51916 | 148  | 
lemma Collect_split_mono_strong:  | 
| 55163 | 149  | 
"\<lbrakk>X = fst ` A; Y = snd ` A; \<forall>a\<in>X. \<forall>b \<in> Y. P a b \<longrightarrow> Q a b; A \<subseteq> Collect (split P)\<rbrakk> \<Longrightarrow>  | 
| 51916 | 150  | 
A \<subseteq> Collect (split Q)"  | 
151  | 
by fastforce  | 
|
152  | 
||
| 55163 | 153  | 
|
| 
51917
 
f964a9887713
store proper theorems even for fixed points that have no passive live variables
 
traytel 
parents: 
51916 
diff
changeset
 | 
154  | 
lemma predicate2_eqD: "A = B \<Longrightarrow> A a b \<longleftrightarrow> B a b"  | 
| 55811 | 155  | 
by simp  | 
| 
49537
 
fe1deee434b6
generate "rel_as_srel" and "rel_flip" properties
 
blanchet 
parents: 
49510 
diff
changeset
 | 
156  | 
|
| 
55414
 
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
 
blanchet 
parents: 
55163 
diff
changeset
 | 
157  | 
lemma case_sum_o_inj:  | 
| 
 
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
 
blanchet 
parents: 
55163 
diff
changeset
 | 
158  | 
"case_sum f g \<circ> Inl = f"  | 
| 
 
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
 
blanchet 
parents: 
55163 
diff
changeset
 | 
159  | 
"case_sum f g \<circ> Inr = g"  | 
| 
52635
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
160  | 
by auto  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
161  | 
|
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
162  | 
lemma card_order_csum_cone_cexp_def:  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
163  | 
  "card_order r \<Longrightarrow> ( |A1| +c cone) ^c r = |Func UNIV (Inl ` A1 \<union> {Inr ()})|"
 | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
164  | 
unfolding cexp_def cone_def Field_csum Field_card_of by (auto dest: Field_card_order)  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
165  | 
|
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
166  | 
lemma If_the_inv_into_in_Func:  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
167  | 
  "\<lbrakk>inj_on g C; C \<subseteq> B \<union> {x}\<rbrakk> \<Longrightarrow>
 | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
168  | 
  (\<lambda>i. if i \<in> g ` C then the_inv_into C g i else x) \<in> Func UNIV (B \<union> {x})"
 | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
169  | 
unfolding Func_def by (auto dest: the_inv_into_into)  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
170  | 
|
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
171  | 
lemma If_the_inv_into_f_f:  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
172  | 
"\<lbrakk>i \<in> C; inj_on g C\<rbrakk> \<Longrightarrow>  | 
| 56635 | 173  | 
((\<lambda>i. if i \<in> g ` C then the_inv_into C g i else x) \<circ> g) i = id i"  | 
| 
52635
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
174  | 
unfolding Func_def by (auto elim: the_inv_into_f_f)  | 
| 
 
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
 
traytel 
parents: 
51917 
diff
changeset
 | 
175  | 
|
| 56635 | 176  | 
lemma the_inv_f_o_f_id: "inj f \<Longrightarrow> (the_inv f \<circ> f) z = id z"  | 
177  | 
by (simp add: the_inv_f_f)  | 
|
178  | 
||
| 52731 | 179  | 
lemma vimage2pI: "R (f x) (g y) \<Longrightarrow> vimage2p f g R x y"  | 
180  | 
unfolding vimage2p_def by -  | 
|
| 
52719
 
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
 
traytel 
parents: 
52660 
diff
changeset
 | 
181  | 
|
| 55945 | 182  | 
lemma rel_fun_iff_leq_vimage2p: "(rel_fun R S) f g = (R \<le> vimage2p f g S)"  | 
183  | 
unfolding rel_fun_def vimage2p_def by auto  | 
|
| 
52719
 
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
 
traytel 
parents: 
52660 
diff
changeset
 | 
184  | 
|
| 56635 | 185  | 
lemma convol_image_vimage2p: "<f \<circ> fst, g \<circ> snd> ` Collect (split (vimage2p f g R)) \<subseteq> Collect (split R)"  | 
| 52731 | 186  | 
unfolding vimage2p_def convol_def by auto  | 
| 
52719
 
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
 
traytel 
parents: 
52660 
diff
changeset
 | 
187  | 
|
| 54961 | 188  | 
lemma vimage2p_Grp: "vimage2p f g P = Grp UNIV f OO P OO (Grp UNIV g)\<inverse>\<inverse>"  | 
189  | 
unfolding vimage2p_def Grp_def by auto  | 
|
190  | 
||
| 57398 | 191  | 
ML_file "Tools/BNF/bnf_util.ML"  | 
192  | 
ML_file "Tools/BNF/bnf_tactics.ML"  | 
|
| 55062 | 193  | 
ML_file "Tools/BNF/bnf_def_tactics.ML"  | 
194  | 
ML_file "Tools/BNF/bnf_def.ML"  | 
|
| 
49309
 
f20b24214ac2
split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
 
blanchet 
parents: 
49286 
diff
changeset
 | 
195  | 
|
| 
48975
 
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
 
blanchet 
parents:  
diff
changeset
 | 
196  | 
end  |