src/HOL/Codatatype/BNF_GFP.thy
author blanchet
Fri, 21 Sep 2012 16:34:40 +0200
changeset 49509 163914705f8d
parent 49328 a1c10b46fecd
permissions -rw-r--r--
renamed top-level theory from "Codatatype" to "BNF"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49509
163914705f8d renamed top-level theory from "Codatatype" to "BNF"
blanchet
parents: 49328
diff changeset
     1
(*  Title:      HOL/BNF/BNF_GFP.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
Greatest fixed point operation on 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 {* Greatest Fixed Point Operation on 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_GFP
49314
f252c7c2ac7b reduced theory dependencies
blanchet
parents: 49313
diff changeset
    11
imports BNF_FP Equiv_Relations_More "~~/src/HOL/Library/Prefix_Order"
48975
7f79f94a432c added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff changeset
    12
keywords
49308
6190b701e4f4 reorganized dependencies so that the sugar does not depend on GFP -- this will be essential for bootstrapping
blanchet
parents: 49074
diff changeset
    13
  "codata_raw" :: thy_decl and
6190b701e4f4 reorganized dependencies so that the sugar does not depend on GFP -- this will be essential for bootstrapping
blanchet
parents: 49074
diff changeset
    14
  "codata" :: thy_decl
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
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    17
lemma sum_case_comp_Inl:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    18
"sum_case f g \<circ> Inl = f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    19
unfolding comp_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    20
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    21
lemma sum_case_expand_Inr: "f o Inl = g \<Longrightarrow> f x = sum_case g (f o Inr) x"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    22
by (auto split: sum.splits)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    23
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    24
lemma converse_Times: "(A \<times> B) ^-1 = B \<times> A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    25
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    26
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    27
lemma equiv_triv1:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    28
assumes "equiv A R" and "(a, b) \<in> R" and "(a, c) \<in> R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    29
shows "(b, c) \<in> R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    30
using assms unfolding equiv_def sym_def trans_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    31
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    32
lemma equiv_triv2:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    33
assumes "equiv A R" and "(a, b) \<in> R" and "(b, c) \<in> R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    34
shows "(a, c) \<in> R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    35
using assms unfolding equiv_def trans_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    36
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    37
lemma equiv_proj:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    38
  assumes e: "equiv A R" and "z \<in> R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    39
  shows "(proj R o fst) z = (proj R o snd) z"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    40
proof -
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    41
  from assms(2) have z: "(fst z, snd z) \<in> R" by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    42
  have P: "\<And>x. (fst z, x) \<in> R \<Longrightarrow> (snd z, x) \<in> R" by (erule equiv_triv1[OF e z])
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    43
  have "\<And>x. (snd z, x) \<in> R \<Longrightarrow> (fst z, x) \<in> R" by (erule equiv_triv2[OF e z])
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    44
  with P show ?thesis unfolding proj_def[abs_def] by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    45
qed
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    46
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    47
(* Operators: *)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    48
definition diag where "diag A \<equiv> {(a,a) | a. a \<in> A}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    49
definition image2 where "image2 A f g = {(f a, g a) | a. a \<in> A}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    50
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    51
lemma diagI: "x \<in> A \<Longrightarrow> (x, x) \<in> diag A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    52
unfolding diag_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    53
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    54
lemma diagE: "(a, b) \<in> diag A \<Longrightarrow> a = b"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    55
unfolding diag_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    56
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    57
lemma diagE': "x \<in> diag A \<Longrightarrow> fst x = snd x"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    58
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    59
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    60
lemma diag_fst: "x \<in> diag A \<Longrightarrow> fst x \<in> A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    61
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    62
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    63
lemma diag_UNIV: "diag UNIV = Id"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    64
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    65
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    66
lemma diag_converse: "diag A = (diag A) ^-1"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    67
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    68
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    69
lemma diag_Comp: "diag A = diag A O diag A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    70
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    71
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    72
lemma diag_Gr: "diag A = Gr A id"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    73
unfolding diag_def Gr_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    74
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    75
lemma diag_UNIV_I: "x = y \<Longrightarrow> (x, y) \<in> diag UNIV"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    76
unfolding diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    77
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    78
lemma image2_eqI: "\<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> image2 A f g"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    79
unfolding image2_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    80
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    81
lemma Id_subset: "Id \<subseteq> {(a, b). P a b \<or> a = b}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    82
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    83
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    84
lemma IdD: "(a, b) \<in> Id \<Longrightarrow> a = b"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    85
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    86
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    87
lemma image2_Gr: "image2 A f g = (Gr A f)^-1 O (Gr A g)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    88
unfolding image2_def Gr_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    89
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    90
lemma GrI: "\<lbrakk>x \<in> A; f x = fx\<rbrakk> \<Longrightarrow> (x, fx) \<in> Gr A f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    91
unfolding Gr_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    92
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    93
lemma GrE: "(x, fx) \<in> Gr A f \<Longrightarrow> (x \<in> A \<Longrightarrow> f x = fx \<Longrightarrow> P) \<Longrightarrow> P"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    94
unfolding Gr_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    95
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    96
lemma GrD1: "(x, fx) \<in> Gr A f \<Longrightarrow> x \<in> A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    97
unfolding Gr_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    98
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
    99
lemma GrD2: "(x, fx) \<in> Gr A f \<Longrightarrow> f x = fx"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   100
unfolding Gr_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   101
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   102
lemma Gr_incl: "Gr A f \<subseteq> A <*> B \<longleftrightarrow> f ` A \<subseteq> B"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   103
unfolding Gr_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   104
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   105
definition relImage where
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   106
"relImage R f \<equiv> {(f a1, f a2) | a1 a2. (a1,a2) \<in> R}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   107
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   108
definition relInvImage where
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   109
"relInvImage A R f \<equiv> {(a1, a2) | a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   110
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   111
lemma relImage_Gr:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   112
"\<lbrakk>R \<subseteq> A \<times> A\<rbrakk> \<Longrightarrow> relImage R f = (Gr A f)^-1 O R O Gr A f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   113
unfolding relImage_def Gr_def relcomp_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   114
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   115
lemma relInvImage_Gr: "\<lbrakk>R \<subseteq> B \<times> B\<rbrakk> \<Longrightarrow> relInvImage A R f = Gr A f O R O (Gr A f)^-1"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   116
unfolding Gr_def relcomp_def image_def relInvImage_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   117
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   118
lemma relImage_mono:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   119
"R1 \<subseteq> R2 \<Longrightarrow> relImage R1 f \<subseteq> relImage R2 f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   120
unfolding relImage_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   121
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   122
lemma relInvImage_mono:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   123
"R1 \<subseteq> R2 \<Longrightarrow> relInvImage A R1 f \<subseteq> relInvImage A R2 f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   124
unfolding relInvImage_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   125
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   126
lemma relInvImage_diag:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   127
"(\<And>a1 a2. f a1 = f a2 \<longleftrightarrow> a1 = a2) \<Longrightarrow> relInvImage A (diag B) f \<subseteq> Id"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   128
unfolding relInvImage_def diag_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   129
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   130
lemma relInvImage_UNIV_relImage:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   131
"R \<subseteq> relInvImage UNIV (relImage R f) f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   132
unfolding relInvImage_def relImage_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   133
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   134
lemma equiv_Image: "equiv A R \<Longrightarrow> (\<And>a b. (a, b) \<in> R \<Longrightarrow> a \<in> A \<and> b \<in> A \<and> R `` {a} = R `` {b})"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   135
unfolding equiv_def refl_on_def Image_def by (auto intro: transD symD)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   136
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   137
lemma relImage_proj:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   138
assumes "equiv A R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   139
shows "relImage R (proj R) \<subseteq> diag (A//R)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   140
unfolding relImage_def diag_def apply safe
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   141
using proj_iff[OF assms]
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   142
by (metis assms equiv_Image proj_def proj_preserves)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   143
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   144
lemma relImage_relInvImage:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   145
assumes "R \<subseteq> f ` A <*> f ` A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   146
shows "relImage (relInvImage A R f) f = R"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   147
using assms unfolding relImage_def relInvImage_def by fastforce
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   148
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   149
lemma subst_Pair: "P x y \<Longrightarrow> a = (x, y) \<Longrightarrow> P (fst a) (snd a)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   150
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   151
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   152
lemma fst_diag_id: "(fst \<circ> (%x. (x, x))) z = id z"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   153
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   154
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   155
lemma snd_diag_id: "(snd \<circ> (%x. (x, x))) z = id z"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   156
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   157
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   158
lemma Collect_restrict': "{(x, y) | x y. phi x y \<and> P x y} \<subseteq> {(x, y) | x y. phi x y}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   159
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   160
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   161
lemma image_convolD: "\<lbrakk>(a, b) \<in> <f, g> ` X\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> X \<and> a = f x \<and> b = g x"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   162
unfolding convol_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   163
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   164
(*Extended Sublist*)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   165
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   166
definition prefCl where
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   167
  "prefCl Kl = (\<forall> kl1 kl2. kl1 \<le> kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   168
definition PrefCl where
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   169
  "PrefCl A n = (\<forall>kl kl'. kl \<in> A n \<and> kl' \<le> kl \<longrightarrow> (\<exists>m\<le>n. kl' \<in> A m))"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   170
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   171
lemma prefCl_UN:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   172
  "\<lbrakk>\<And>n. PrefCl A n\<rbrakk> \<Longrightarrow> prefCl (\<Union>n. A n)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   173
unfolding prefCl_def PrefCl_def by fastforce
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   174
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   175
definition Succ where "Succ Kl kl = {k . kl @ [k] \<in> Kl}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   176
definition Shift where "Shift Kl k = {kl. k # kl \<in> Kl}"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   177
definition shift where "shift lab k = (\<lambda>kl. lab (k # kl))"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   178
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   179
lemma empty_Shift: "\<lbrakk>[] \<in> Kl; k \<in> Succ Kl []\<rbrakk> \<Longrightarrow> [] \<in> Shift Kl k"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   180
unfolding Shift_def Succ_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   181
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   182
lemma Shift_clists: "Kl \<subseteq> Field (clists r) \<Longrightarrow> Shift Kl k \<subseteq> Field (clists r)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   183
unfolding Shift_def clists_def Field_card_of by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   184
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   185
lemma Shift_prefCl: "prefCl Kl \<Longrightarrow> prefCl (Shift Kl k)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   186
unfolding prefCl_def Shift_def
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   187
proof safe
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   188
  fix kl1 kl2
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   189
  assume "\<forall>kl1 kl2. kl1 \<le> kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   190
    "kl1 \<le> kl2" "k # kl2 \<in> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   191
  thus "k # kl1 \<in> Kl" using Cons_prefix_Cons[of k kl1 k kl2] by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   192
qed
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   193
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   194
lemma not_in_Shift: "kl \<notin> Shift Kl x \<Longrightarrow> x # kl \<notin> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   195
unfolding Shift_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   196
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   197
lemma prefCl_Succ: "\<lbrakk>prefCl Kl; k # kl \<in> Kl\<rbrakk> \<Longrightarrow> k \<in> Succ Kl []"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   198
unfolding Succ_def proof
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   199
  assume "prefCl Kl" "k # kl \<in> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   200
  moreover have "k # [] \<le> k # kl" by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   201
  ultimately have "k # [] \<in> Kl" unfolding prefCl_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   202
  thus "[] @ [k] \<in> Kl" by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   203
qed
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   204
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   205
lemma SuccD: "k \<in> Succ Kl kl \<Longrightarrow> kl @ [k] \<in> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   206
unfolding Succ_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   207
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   208
lemmas SuccE = SuccD[elim_format]
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   209
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   210
lemma SuccI: "kl @ [k] \<in> Kl \<Longrightarrow> k \<in> Succ Kl kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   211
unfolding Succ_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   212
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   213
lemma ShiftD: "kl \<in> Shift Kl k \<Longrightarrow> k # kl \<in> Kl"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   214
unfolding Shift_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   215
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   216
lemma Succ_Shift: "Succ (Shift Kl k) kl = Succ Kl (k # kl)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   217
unfolding Succ_def Shift_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   218
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   219
lemma ShiftI: "k # kl \<in> Kl \<Longrightarrow> kl \<in> Shift Kl k"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   220
unfolding Shift_def by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   221
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   222
lemma Func_cexp: "|Func A B| =o |B| ^c |A|"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   223
unfolding cexp_def Field_card_of by (simp only: card_of_refl)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   224
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   225
lemma clists_bound: "A \<in> Field (cpow (clists r)) - {{}} \<Longrightarrow> |A| \<le>o clists r"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   226
unfolding cpow_def clists_def Field_card_of by (auto simp: card_of_mono1)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   227
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   228
lemma cpow_clists_czero: "\<lbrakk>A \<in> Field (cpow (clists r)) - {{}}; |A| =o czero\<rbrakk> \<Longrightarrow> False"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   229
unfolding cpow_def clists_def
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   230
by (auto simp add: card_of_ordIso_czero_iff_empty[symmetric])
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   231
   (erule notE, erule ordIso_transitive, rule czero_ordIso)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   232
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   233
lemma incl_UNION_I:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   234
assumes "i \<in> I" and "A \<subseteq> F i"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   235
shows "A \<subseteq> UNION I F"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   236
using assms by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   237
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   238
lemma Nil_clists: "{[]} \<subseteq> Field (clists r)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   239
unfolding clists_def Field_card_of by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   240
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   241
lemma Cons_clists:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   242
  "\<lbrakk>x \<in> Field r; xs \<in> Field (clists r)\<rbrakk> \<Longrightarrow> x # xs \<in> Field (clists r)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   243
unfolding clists_def Field_card_of by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   244
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   245
lemma length_Cons: "length (x # xs) = Suc (length xs)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   246
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   247
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   248
lemma length_append_singleton: "length (xs @ [x]) = Suc (length xs)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   249
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   250
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   251
(*injection into the field of a cardinal*)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   252
definition "toCard_pred A r f \<equiv> inj_on f A \<and> f ` A \<subseteq> Field r \<and> Card_order r"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   253
definition "toCard A r \<equiv> SOME f. toCard_pred A r f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   254
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   255
lemma ex_toCard_pred:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   256
"\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists> f. toCard_pred A r f"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   257
unfolding toCard_pred_def
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   258
using card_of_ordLeq[of A "Field r"]
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   259
      ordLeq_ordIso_trans[OF _ card_of_unique[of "Field r" r], of "|A|"]
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   260
by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   261
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   262
lemma toCard_pred_toCard:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   263
  "\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> toCard_pred A r (toCard A r)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   264
unfolding toCard_def using someI_ex[OF ex_toCard_pred] .
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   265
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   266
lemma toCard_inj: "\<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow>
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   267
  toCard A r x = toCard A r y \<longleftrightarrow> x = y"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   268
using toCard_pred_toCard unfolding inj_on_def toCard_pred_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   269
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   270
lemma toCard: "\<lbrakk>|A| \<le>o r; Card_order r; b \<in> A\<rbrakk> \<Longrightarrow> toCard A r b \<in> Field r"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   271
using toCard_pred_toCard unfolding toCard_pred_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   272
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   273
definition "fromCard A r k \<equiv> SOME b. b \<in> A \<and> toCard A r b = k"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   274
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   275
lemma fromCard_toCard:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   276
"\<lbrakk>|A| \<le>o r; Card_order r; b \<in> A\<rbrakk> \<Longrightarrow> fromCard A r (toCard A r b) = b"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   277
unfolding fromCard_def by (rule some_equality) (auto simp add: toCard_inj)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   278
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   279
(* pick according to the weak pullback *)
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   280
definition pickWP_pred where
49325
blanchet
parents: 49314
diff changeset
   281
"pickWP_pred A p1 p2 b1 b2 a \<equiv> a \<in> A \<and> p1 a = b1 \<and> p2 a = b2"
49312
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   282
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   283
definition pickWP where
49325
blanchet
parents: 49314
diff changeset
   284
"pickWP A p1 p2 b1 b2 \<equiv> SOME a. pickWP_pred A p1 p2 b1 b2 a"
49312
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   285
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   286
lemma pickWP_pred:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   287
assumes "wpull A B1 B2 f1 f2 p1 p2" and
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   288
"b1 \<in> B1" and "b2 \<in> B2" and "f1 b1 = f2 b2"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   289
shows "\<exists> a. pickWP_pred A p1 p2 b1 b2 a"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   290
using assms unfolding wpull_def pickWP_pred_def by blast
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   291
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   292
lemma pickWP_pred_pickWP:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   293
assumes "wpull A B1 B2 f1 f2 p1 p2" and
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   294
"b1 \<in> B1" and "b2 \<in> B2" and "f1 b1 = f2 b2"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   295
shows "pickWP_pred A p1 p2 b1 b2 (pickWP A p1 p2 b1 b2)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   296
unfolding pickWP_def using assms by(rule someI_ex[OF pickWP_pred])
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   297
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   298
lemma pickWP:
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   299
assumes "wpull A B1 B2 f1 f2 p1 p2" and
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   300
"b1 \<in> B1" and "b2 \<in> B2" and "f1 b1 = f2 b2"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   301
shows "pickWP A p1 p2 b1 b2 \<in> A"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   302
      "p1 (pickWP A p1 p2 b1 b2) = b1"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   303
      "p2 (pickWP A p1 p2 b1 b2) = b2"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   304
using assms pickWP_pred_pickWP unfolding pickWP_pred_def by fastforce+
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   305
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   306
lemma Inl_Field_csum: "a \<in> Field r \<Longrightarrow> Inl a \<in> Field (r +c s)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   307
unfolding Field_card_of csum_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   308
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   309
lemma Inr_Field_csum: "a \<in> Field s \<Longrightarrow> Inr a \<in> Field (r +c s)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   310
unfolding Field_card_of csum_def by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   311
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   312
lemma nat_rec_0: "f = nat_rec f1 (%n rec. f2 n rec) \<Longrightarrow> f 0 = f1"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   313
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   314
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   315
lemma nat_rec_Suc: "f = nat_rec f1 (%n rec. f2 n rec) \<Longrightarrow> f (Suc n) = f2 n (f n)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   316
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   317
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   318
lemma list_rec_Nil: "f = list_rec f1 (%x xs rec. f2 x xs rec) \<Longrightarrow> f [] = f1"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   319
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   320
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   321
lemma list_rec_Cons: "f = list_rec f1 (%x xs rec. f2 x xs rec) \<Longrightarrow> f (x # xs) = f2 x xs (f xs)"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   322
by auto
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   323
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   324
lemma not_arg_cong_Inr: "x \<noteq> y \<Longrightarrow> Inr x \<noteq> Inr y"
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   325
by simp
c874ff5658dc moved theorems closer to where they are used
blanchet
parents: 49309
diff changeset
   326
49309
f20b24214ac2 split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
blanchet
parents: 49308
diff changeset
   327
ML_file "Tools/bnf_gfp_util.ML"
f20b24214ac2 split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
blanchet
parents: 49308
diff changeset
   328
ML_file "Tools/bnf_gfp_tactics.ML"
f20b24214ac2 split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
blanchet
parents: 49308
diff changeset
   329
ML_file "Tools/bnf_gfp.ML"
f20b24214ac2 split basic BNFs into really basic ones and others, and added Andreas Lochbihler's "option" BNF
blanchet
parents: 49308
diff changeset
   330
48975
7f79f94a432c added new (co)datatype package + theories of ordinals and cardinals (with Dmitriy and Andrei)
blanchet
parents:
diff changeset
   331
end