author | traytel |
Mon, 22 Jul 2013 21:12:15 +0200 | |
changeset 52719 | 480a3479fa47 |
parent 52660 | 7f7311d04727 |
child 52730 | 6bf02eb4ddf7 |
permissions | -rw-r--r-- |
49509
163914705f8d
renamed top-level theory from "Codatatype" to "BNF"
blanchet
parents:
49495
diff
changeset
|
1 |
(* Title: HOL/BNF/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 |
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
3 |
Copyright 2012 |
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
4 |
|
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
5 |
Definition of bounded natural functors. |
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 |
|
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
8 |
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
|
9 |
|
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
10 |
theory BNF_Def |
49282 | 11 |
imports BNF_Util |
48975
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
12 |
keywords |
49286 | 13 |
"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
|
14 |
"bnf" :: thy_goal |
48975
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
15 |
begin |
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
16 |
|
49312 | 17 |
lemma collect_o: "collect F o g = collect ((\<lambda>f. f o g) ` F)" |
18 |
by (rule ext) (auto simp only: o_apply collect_def) |
|
19 |
||
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
20 |
lemma conversep_mono: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
21 |
"R1 ^--1 \<le> R2 ^--1 \<longleftrightarrow> R1 \<le> R2" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
22 |
unfolding conversep.simps by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
23 |
|
49312 | 24 |
lemma converse_shift: |
25 |
"R1 \<subseteq> R2 ^-1 \<Longrightarrow> R1 ^-1 \<subseteq> R2" |
|
26 |
unfolding converse_def by auto |
|
27 |
||
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
28 |
lemma conversep_shift: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
29 |
"R1 \<le> R2 ^--1 \<Longrightarrow> R1 ^--1 \<le> R2" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
30 |
unfolding conversep.simps by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
31 |
|
49495 | 32 |
definition convol ("<_ , _>") where |
33 |
"<f , g> \<equiv> %a. (f a, g a)" |
|
34 |
||
35 |
lemma fst_convol: |
|
36 |
"fst o <f , g> = f" |
|
37 |
apply(rule ext) |
|
38 |
unfolding convol_def by simp |
|
39 |
||
40 |
lemma snd_convol: |
|
41 |
"snd o <f , g> = g" |
|
42 |
apply(rule ext) |
|
43 |
unfolding convol_def by simp |
|
44 |
||
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
45 |
lemma convol_mem_GrpI: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
46 |
"\<lbrakk>g x = g' x; x \<in> A\<rbrakk> \<Longrightarrow> <id , g> x \<in> (Collect (split (Grp A g)))" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
47 |
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
|
48 |
|
49312 | 49 |
definition csquare where |
50 |
"csquare A f1 f2 p1 p2 \<longleftrightarrow> (\<forall> a \<in> A. f1 (p1 a) = f2 (p2 a))" |
|
51 |
||
52 |
(* The pullback of sets *) |
|
53 |
definition thePull where |
|
54 |
"thePull B1 B2 f1 f2 = {(b1,b2). b1 \<in> B1 \<and> b2 \<in> B2 \<and> f1 b1 = f2 b2}" |
|
55 |
||
56 |
lemma wpull_thePull: |
|
57 |
"wpull (thePull B1 B2 f1 f2) B1 B2 f1 f2 fst snd" |
|
58 |
unfolding wpull_def thePull_def by auto |
|
59 |
||
60 |
lemma wppull_thePull: |
|
61 |
assumes "wppull A B1 B2 f1 f2 e1 e2 p1 p2" |
|
62 |
shows |
|
63 |
"\<exists> j. \<forall> a' \<in> thePull B1 B2 f1 f2. |
|
64 |
j a' \<in> A \<and> |
|
65 |
e1 (p1 (j a')) = e1 (fst a') \<and> e2 (p2 (j a')) = e2 (snd a')" |
|
66 |
(is "\<exists> j. \<forall> a' \<in> ?A'. ?phi a' (j a')") |
|
67 |
proof(rule bchoice[of ?A' ?phi], default) |
|
68 |
fix a' assume a': "a' \<in> ?A'" |
|
69 |
hence "fst a' \<in> B1" unfolding thePull_def by auto |
|
70 |
moreover |
|
71 |
from a' have "snd a' \<in> B2" unfolding thePull_def by auto |
|
72 |
moreover have "f1 (fst a') = f2 (snd a')" |
|
73 |
using a' unfolding csquare_def thePull_def by auto |
|
74 |
ultimately show "\<exists> ja'. ?phi a' ja'" |
|
49325 | 75 |
using assms unfolding wppull_def by blast |
49312 | 76 |
qed |
77 |
||
78 |
lemma wpull_wppull: |
|
79 |
assumes wp: "wpull A' B1 B2 f1 f2 p1' p2'" and |
|
80 |
1: "\<forall> a' \<in> A'. j a' \<in> A \<and> e1 (p1 (j a')) = e1 (p1' a') \<and> e2 (p2 (j a')) = e2 (p2' a')" |
|
81 |
shows "wppull A B1 B2 f1 f2 e1 e2 p1 p2" |
|
82 |
unfolding wppull_def proof safe |
|
83 |
fix b1 b2 |
|
84 |
assume b1: "b1 \<in> B1" and b2: "b2 \<in> B2" and f: "f1 b1 = f2 b2" |
|
85 |
then obtain a' where a': "a' \<in> A'" and b1: "b1 = p1' a'" and b2: "b2 = p2' a'" |
|
86 |
using wp unfolding wpull_def by blast |
|
87 |
show "\<exists>a\<in>A. e1 (p1 a) = e1 b1 \<and> e2 (p2 a) = e2 b2" |
|
49325 | 88 |
apply (rule bexI[of _ "j a'"]) unfolding b1 b2 using a' 1 by auto |
49312 | 89 |
qed |
90 |
||
91 |
lemma wppull_id: "\<lbrakk>wpull UNIV UNIV UNIV f1 f2 p1 p2; e1 = id; e2 = id\<rbrakk> \<Longrightarrow> |
|
92 |
wppull UNIV UNIV UNIV f1 f2 e1 e2 p1 p2" |
|
93 |
by (erule wpull_wppull) auto |
|
94 |
||
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
95 |
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
|
96 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
97 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
98 |
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
|
99 |
by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
100 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
101 |
lemma eq_OOI: "R = op = \<Longrightarrow> R = R OO R" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
102 |
by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
103 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
104 |
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
|
105 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
106 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
107 |
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
|
108 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
109 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
110 |
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
|
111 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
112 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
113 |
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
|
114 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
115 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
116 |
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
|
117 |
unfolding Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
118 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
119 |
lemma Collect_split_Grp_eqD: "z \<in> Collect (split (Grp A f)) \<Longrightarrow> (f \<circ> fst) z = snd z" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
120 |
unfolding Grp_def o_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
121 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
122 |
lemma Collect_split_Grp_inD: "z \<in> Collect (split (Grp A f)) \<Longrightarrow> fst z \<in> A" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
123 |
unfolding Grp_def o_def by auto |
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 wpull_Grp: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
126 |
"wpull (Collect (split (Grp A f))) A (f ` A) f id fst snd" |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
127 |
unfolding wpull_def Grp_def by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
128 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
129 |
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
|
130 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
131 |
lemma pick_middlep: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
132 |
"(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
|
133 |
unfolding pick_middlep_def apply(rule someI_ex) by auto |
49312 | 134 |
|
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
135 |
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
|
136 |
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
|
137 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
138 |
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
|
139 |
unfolding fstOp_def mem_Collect_eq |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
140 |
by (subst (asm) surjective_pairing, unfold prod.cases) (erule pick_middlep[THEN conjunct1]) |
49312 | 141 |
|
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
142 |
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
|
143 |
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
|
144 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
145 |
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
|
146 |
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
|
147 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
148 |
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
|
149 |
unfolding sndOp_def mem_Collect_eq |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
150 |
by (subst (asm) surjective_pairing, unfold prod.cases) (erule pick_middlep[THEN conjunct2]) |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
151 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
152 |
lemma csquare_fstOp_sndOp: |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
153 |
"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
|
154 |
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
|
155 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
156 |
lemma wppull_fstOp_sndOp: |
51909 | 157 |
shows "wppull (Collect (split (P OO Q))) (Collect (split P)) (Collect (split Q)) |
158 |
snd fst fst snd (fstOp P Q) (sndOp P Q)" |
|
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
159 |
using pick_middlep unfolding wppull_def fstOp_def sndOp_def relcompp.simps by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
160 |
|
49312 | 161 |
lemma snd_fst_flip: "snd xy = (fst o (%(x, y). (y, x))) xy" |
162 |
by (simp split: prod.split) |
|
163 |
||
164 |
lemma fst_snd_flip: "fst xy = (snd o (%(x, y). (y, x))) xy" |
|
165 |
by (simp split: prod.split) |
|
166 |
||
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
167 |
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
|
168 |
by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
169 |
|
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
170 |
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
|
171 |
by auto |
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
172 |
|
51916 | 173 |
lemma Collect_split_mono_strong: |
174 |
"\<lbrakk>\<forall>a\<in>fst ` A. \<forall>b \<in> snd ` A. P a b \<longrightarrow> Q a b; A \<subseteq> Collect (split P)\<rbrakk> \<Longrightarrow> |
|
175 |
A \<subseteq> Collect (split Q)" |
|
176 |
by fastforce |
|
177 |
||
51917
f964a9887713
store proper theorems even for fixed points that have no passive live variables
traytel
parents:
51916
diff
changeset
|
178 |
lemma predicate2_eqD: "A = B \<Longrightarrow> A a b \<longleftrightarrow> B a b" |
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
179 |
by metis |
49537
fe1deee434b6
generate "rel_as_srel" and "rel_flip" properties
blanchet
parents:
49510
diff
changeset
|
180 |
|
52635
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
181 |
lemma sum_case_o_inj: |
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
182 |
"sum_case f g \<circ> Inl = f" |
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
183 |
"sum_case f g \<circ> Inr = g" |
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
184 |
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
|
185 |
|
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
186 |
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
|
187 |
"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
|
188 |
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
|
189 |
|
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
190 |
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
|
191 |
"\<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
|
192 |
(\<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
|
193 |
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
|
194 |
|
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
195 |
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
|
196 |
"\<lbrakk>i \<in> C; inj_on g C\<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
|
197 |
((\<lambda>i. if i \<in> g ` C then the_inv_into C g i else x) o g) i = id i" |
4f84b730c489
got rid of in_bd BNF property (derivable from set_bd+map_cong+map_comp+map_id)
traytel
parents:
51917
diff
changeset
|
198 |
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
|
199 |
|
52719
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
200 |
definition vimagep where |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
201 |
"vimagep f g R = (\<lambda>x y. R (f x) (g y))" |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
202 |
|
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
203 |
lemma vimagepI: "R (f x) (g y) \<Longrightarrow> vimagep f g R x y" |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
204 |
unfolding vimagep_def by - |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
205 |
|
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
206 |
lemma vimagepD: "vimagep f g R x y \<Longrightarrow> R (f x) (g y)" |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
207 |
unfolding vimagep_def by - |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
208 |
|
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
209 |
lemma fun_rel_iff_leq_vimagep: "(fun_rel R S) f g = (R \<le> vimagep f g S)" |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
210 |
unfolding fun_rel_def vimagep_def by auto |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
211 |
|
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
212 |
lemma convol_image_vimagep: "<f o fst, g o snd> ` Collect (split (vimagep f g R)) \<subseteq> Collect (split R)" |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
213 |
unfolding vimagep_def convol_def by auto |
480a3479fa47
transfer rule for map (not yet registered as a transfer rule)
traytel
parents:
52660
diff
changeset
|
214 |
|
49309
f20b24214ac2
split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
blanchet
parents:
49286
diff
changeset
|
215 |
ML_file "Tools/bnf_def_tactics.ML" |
49537
fe1deee434b6
generate "rel_as_srel" and "rel_flip" properties
blanchet
parents:
49510
diff
changeset
|
216 |
ML_file "Tools/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
|
217 |
|
51893
596baae88a88
got rid of the set based relator---use (binary) predicate based relator instead
traytel
parents:
51836
diff
changeset
|
218 |
|
48975
7f79f94a432c
added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff
changeset
|
219 |
end |