author | nipkow |
Thu, 31 Aug 2017 09:50:11 +0200 | |
changeset 66566 | a14bbbaa628d |
parent 63167 | 0909deb8059b |
child 67443 | 3abf6a722518 |
permissions | -rw-r--r-- |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
1 |
(* Title: HOL/Cardinals/Wellorder_Extension.thy |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
2 |
Author: Christian Sternagel, JAIST |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
3 |
*) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
4 |
|
63167 | 5 |
section \<open>Extending Well-founded Relations to Wellorders\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
6 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
7 |
theory Wellorder_Extension |
55811 | 8 |
imports Main Order_Union |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
9 |
begin |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
10 |
|
63167 | 11 |
subsection \<open>Extending Well-founded Relations to Wellorders\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
12 |
|
63167 | 13 |
text \<open>A \emph{downset} (also lower set, decreasing set, initial segment, or |
14 |
downward closed set) is closed w.r.t.\ smaller elements.\<close> |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
15 |
definition downset_on where |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
16 |
"downset_on A r = (\<forall>x y. (x, y) \<in> r \<and> y \<in> A \<longrightarrow> x \<in> A)" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
17 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
18 |
(* |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
19 |
text {*Connection to order filters of the @{theory Cardinals} theory.*} |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
20 |
lemma (in wo_rel) ofilter_downset_on_conv: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
21 |
"ofilter A \<longleftrightarrow> downset_on A r \<and> A \<subseteq> Field r" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
22 |
by (auto simp: downset_on_def ofilter_def under_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
23 |
*) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
24 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
25 |
lemma downset_onI: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
26 |
"(\<And>x y. (x, y) \<in> r \<Longrightarrow> y \<in> A \<Longrightarrow> x \<in> A) \<Longrightarrow> downset_on A r" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
27 |
by (auto simp: downset_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
28 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
29 |
lemma downset_onD: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
30 |
"downset_on A r \<Longrightarrow> (x, y) \<in> r \<Longrightarrow> y \<in> A \<Longrightarrow> x \<in> A" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
31 |
unfolding downset_on_def by blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
32 |
|
63167 | 33 |
text \<open>Extensions of relations w.r.t.\ a given set.\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
34 |
definition extension_on where |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
35 |
"extension_on A r s = (\<forall>x\<in>A. \<forall>y\<in>A. (x, y) \<in> s \<longrightarrow> (x, y) \<in> r)" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
36 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
37 |
lemma extension_onI: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
38 |
"(\<And>x y. \<lbrakk>x \<in> A; y \<in> A; (x, y) \<in> s\<rbrakk> \<Longrightarrow> (x, y) \<in> r) \<Longrightarrow> extension_on A r s" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
39 |
by (auto simp: extension_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
40 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
41 |
lemma extension_onD: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
42 |
"extension_on A r s \<Longrightarrow> x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> (x, y) \<in> s \<Longrightarrow> (x, y) \<in> r" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
43 |
by (auto simp: extension_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
44 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
45 |
lemma downset_on_Union: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
46 |
assumes "\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
47 |
shows "downset_on (Field (\<Union>R)) p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
48 |
using assms by (auto intro: downset_onI dest: downset_onD) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
49 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
50 |
lemma chain_subset_extension_on_Union: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
51 |
assumes "chain\<^sub>\<subseteq> R" and "\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
52 |
shows "extension_on (Field (\<Union>R)) (\<Union>R) p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
53 |
using assms |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
54 |
by (simp add: chain_subset_def extension_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
55 |
(metis (no_types) mono_Field set_mp) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
56 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
57 |
lemma downset_on_empty [simp]: "downset_on {} p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
58 |
by (auto simp: downset_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
59 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
60 |
lemma extension_on_empty [simp]: "extension_on {} p q" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
61 |
by (auto simp: extension_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
62 |
|
63167 | 63 |
text \<open>Every well-founded relation can be extended to a wellorder.\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
64 |
theorem well_order_extension: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
65 |
assumes "wf p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
66 |
shows "\<exists>w. p \<subseteq> w \<and> Well_order w" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
67 |
proof - |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
68 |
let ?K = "{r. Well_order r \<and> downset_on (Field r) p \<and> extension_on (Field r) r p}" |
63040 | 69 |
define I where "I = init_seg_of \<inter> ?K \<times> ?K" |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
70 |
have I_init: "I \<subseteq> init_seg_of" by (simp add: I_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
71 |
then have subch: "\<And>R. R \<in> Chains I \<Longrightarrow> chain\<^sub>\<subseteq> R" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
72 |
by (auto simp: init_seg_of_def chain_subset_def Chains_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
73 |
have Chains_wo: "\<And>R r. R \<in> Chains I \<Longrightarrow> r \<in> R \<Longrightarrow> |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
74 |
Well_order r \<and> downset_on (Field r) p \<and> extension_on (Field r) r p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
75 |
by (simp add: Chains_def I_def) blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
76 |
have FI: "Field I = ?K" by (auto simp: I_def init_seg_of_def Field_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
77 |
then have 0: "Partial_order I" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
78 |
by (auto simp: partial_order_on_def preorder_on_def antisym_def antisym_init_seg_of refl_on_def |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
79 |
trans_def I_def elim: trans_init_seg_of) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
80 |
{ fix R assume "R \<in> Chains I" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
81 |
then have Ris: "R \<in> Chains init_seg_of" using mono_Chains [OF I_init] by blast |
63167 | 82 |
have subch: "chain\<^sub>\<subseteq> R" using \<open>R \<in> Chains I\<close> I_init |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
83 |
by (auto simp: init_seg_of_def chain_subset_def Chains_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
84 |
have "\<forall>r\<in>R. Refl r" and "\<forall>r\<in>R. trans r" and "\<forall>r\<in>R. antisym r" and |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
85 |
"\<forall>r\<in>R. Total r" and "\<forall>r\<in>R. wf (r - Id)" and |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
86 |
"\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p" and |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
87 |
"\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p" |
63167 | 88 |
using Chains_wo [OF \<open>R \<in> Chains I\<close>] by (simp_all add: order_on_defs) |
89 |
have "Refl (\<Union>R)" using \<open>\<forall>r\<in>R. Refl r\<close> unfolding refl_on_def by fastforce |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
90 |
moreover have "trans (\<Union>R)" |
63167 | 91 |
by (rule chain_subset_trans_Union [OF subch \<open>\<forall>r\<in>R. trans r\<close>]) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
92 |
moreover have "antisym (\<Union>R)" |
63167 | 93 |
by (rule chain_subset_antisym_Union [OF subch \<open>\<forall>r\<in>R. antisym r\<close>]) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
94 |
moreover have "Total (\<Union>R)" |
63167 | 95 |
by (rule chain_subset_Total_Union [OF subch \<open>\<forall>r\<in>R. Total r\<close>]) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
96 |
moreover have "wf ((\<Union>R) - Id)" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
97 |
proof - |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
98 |
have "(\<Union>R) - Id = \<Union>{r - Id | r. r \<in> R}" by blast |
63167 | 99 |
with \<open>\<forall>r\<in>R. wf (r - Id)\<close> wf_Union_wf_init_segs [OF Chains_inits_DiffI [OF Ris]] |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
100 |
show ?thesis by fastforce |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
101 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
102 |
ultimately have "Well_order (\<Union>R)" by (simp add: order_on_defs) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
103 |
moreover have "\<forall>r\<in>R. r initial_segment_of \<Union>R" using Ris |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
104 |
by (simp add: Chains_init_seg_of_Union) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
105 |
moreover have "downset_on (Field (\<Union>R)) p" |
63167 | 106 |
by (rule downset_on_Union [OF \<open>\<And>r. r \<in> R \<Longrightarrow> downset_on (Field r) p\<close>]) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
107 |
moreover have "extension_on (Field (\<Union>R)) (\<Union>R) p" |
63167 | 108 |
by (rule chain_subset_extension_on_Union [OF subch \<open>\<And>r. r \<in> R \<Longrightarrow> extension_on (Field r) r p\<close>]) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
109 |
ultimately have "\<Union>R \<in> ?K \<and> (\<forall>r\<in>R. (r,\<Union>R) \<in> I)" |
63167 | 110 |
using mono_Chains [OF I_init] and \<open>R \<in> Chains I\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
111 |
by (simp (no_asm) add: I_def del: Field_Union) (metis Chains_wo) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
112 |
} |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
113 |
then have 1: "\<forall>R\<in>Chains I. \<exists>u\<in>Field I. \<forall>r\<in>R. (r, u) \<in> I" by (subst FI) blast |
63167 | 114 |
txt \<open>Zorn's Lemma yields a maximal wellorder m.\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
115 |
from Zorns_po_lemma [OF 0 1] obtain m :: "('a \<times> 'a) set" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
116 |
where "Well_order m" and "downset_on (Field m) p" and "extension_on (Field m) m p" and |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
117 |
max: "\<forall>r. Well_order r \<and> downset_on (Field r) p \<and> extension_on (Field r) r p \<and> |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
118 |
(m, r) \<in> I \<longrightarrow> r = m" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
119 |
by (auto simp: FI) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
120 |
have "Field p \<subseteq> Field m" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
121 |
proof (rule ccontr) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
122 |
let ?Q = "Field p - Field m" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
123 |
assume "\<not> (Field p \<subseteq> Field m)" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
124 |
with assms [unfolded wf_eq_minimal, THEN spec, of ?Q] |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
125 |
obtain x where "x \<in> Field p" and "x \<notin> Field m" and |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
126 |
min: "\<forall>y. (y, x) \<in> p \<longrightarrow> y \<notin> ?Q" by blast |
63167 | 127 |
txt \<open>Add @{term x} as topmost element to @{term m}.\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
128 |
let ?s = "{(y, x) | y. y \<in> Field m}" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
129 |
let ?m = "insert (x, x) m \<union> ?s" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
130 |
have Fm: "Field ?m = insert x (Field m)" by (auto simp: Field_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
131 |
have "Refl m" and "trans m" and "antisym m" and "Total m" and "wf (m - Id)" |
63167 | 132 |
using \<open>Well_order m\<close> by (simp_all add: order_on_defs) |
133 |
txt \<open>We show that the extension is a wellorder.\<close> |
|
134 |
have "Refl ?m" using \<open>Refl m\<close> Fm by (auto simp: refl_on_def) |
|
135 |
moreover have "trans ?m" using \<open>trans m\<close> \<open>x \<notin> Field m\<close> |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
136 |
unfolding trans_def Field_def Domain_unfold Domain_converse [symmetric] by blast |
63167 | 137 |
moreover have "antisym ?m" using \<open>antisym m\<close> \<open>x \<notin> Field m\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
138 |
unfolding antisym_def Field_def Domain_unfold Domain_converse [symmetric] by blast |
63167 | 139 |
moreover have "Total ?m" using \<open>Total m\<close> Fm by (auto simp: Relation.total_on_def) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
140 |
moreover have "wf (?m - Id)" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
141 |
proof - |
63167 | 142 |
have "wf ?s" using \<open>x \<notin> Field m\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
143 |
by (simp add: wf_eq_minimal Field_def Domain_unfold Domain_converse [symmetric]) metis |
63167 | 144 |
thus ?thesis using \<open>wf (m - Id)\<close> \<open>x \<notin> Field m\<close> |
145 |
wf_subset [OF \<open>wf ?s\<close> Diff_subset] |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
146 |
by (fastforce intro!: wf_Un simp add: Un_Diff Field_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
147 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
148 |
ultimately have "Well_order ?m" by (simp add: order_on_defs) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
149 |
moreover have "extension_on (Field ?m) ?m p" |
63167 | 150 |
using \<open>extension_on (Field m) m p\<close> \<open>downset_on (Field m) p\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
151 |
by (subst Fm) (auto simp: extension_on_def dest: downset_onD) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
152 |
moreover have "downset_on (Field ?m) p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
153 |
apply (subst Fm) |
63167 | 154 |
using \<open>downset_on (Field m) p\<close> and min |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
155 |
unfolding downset_on_def Field_def by blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
156 |
moreover have "(m, ?m) \<in> I" |
63167 | 157 |
using \<open>Well_order m\<close> and \<open>Well_order ?m\<close> and |
158 |
\<open>downset_on (Field m) p\<close> and \<open>downset_on (Field ?m) p\<close> and |
|
159 |
\<open>extension_on (Field m) m p\<close> and \<open>extension_on (Field ?m) ?m p\<close> and |
|
160 |
\<open>Refl m\<close> and \<open>x \<notin> Field m\<close> |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
161 |
by (auto simp: I_def init_seg_of_def refl_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
162 |
ultimately |
63167 | 163 |
\<comment>\<open>This contradicts maximality of m:\<close> |
164 |
show False using max and \<open>x \<notin> Field m\<close> unfolding Field_def by blast |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
165 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
166 |
have "p \<subseteq> m" |
63167 | 167 |
using \<open>Field p \<subseteq> Field m\<close> and \<open>extension_on (Field m) m p\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
168 |
unfolding Field_def extension_on_def by auto fast |
63167 | 169 |
with \<open>Well_order m\<close> show ?thesis by blast |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
170 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
171 |
|
63167 | 172 |
text \<open>Every well-founded relation can be extended to a total wellorder.\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
173 |
corollary total_well_order_extension: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
174 |
assumes "wf p" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
175 |
shows "\<exists>w. p \<subseteq> w \<and> Well_order w \<and> Field w = UNIV" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
176 |
proof - |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
177 |
from well_order_extension [OF assms] obtain w |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
178 |
where "p \<subseteq> w" and wo: "Well_order w" by blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
179 |
let ?A = "UNIV - Field w" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
180 |
from well_order_on [of ?A] obtain w' where wo': "well_order_on ?A w'" .. |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
55018
diff
changeset
|
181 |
have [simp]: "Field w' = ?A" using well_order_on_Well_order [OF wo'] by simp |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
182 |
have *: "Field w \<inter> Field w' = {}" by simp |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
183 |
let ?w = "w \<union>o w'" |
63167 | 184 |
have "p \<subseteq> ?w" using \<open>p \<subseteq> w\<close> by (auto simp: Osum_def) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
185 |
moreover have "Well_order ?w" using Osum_Well_order [OF * wo] and wo' by simp |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
186 |
moreover have "Field ?w = UNIV" by (simp add: Field_Osum) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
187 |
ultimately show ?thesis by blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
188 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
189 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
190 |
corollary well_order_on_extension: |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
191 |
assumes "wf p" and "Field p \<subseteq> A" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
192 |
shows "\<exists>w. p \<subseteq> w \<and> well_order_on A w" |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
193 |
proof - |
63167 | 194 |
from total_well_order_extension [OF \<open>wf p\<close>] obtain r |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
195 |
where "p \<subseteq> r" and wo: "Well_order r" and univ: "Field r = UNIV" by blast |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
196 |
let ?r = "{(x, y). x \<in> A \<and> y \<in> A \<and> (x, y) \<in> r}" |
63167 | 197 |
from \<open>p \<subseteq> r\<close> have "p \<subseteq> ?r" using \<open>Field p \<subseteq> A\<close> by (auto simp: Field_def) |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
198 |
have 1: "Field ?r = A" using wo univ |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
199 |
by (fastforce simp: Field_def order_on_defs refl_on_def) |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
200 |
have "Refl r" "trans r" "antisym r" "Total r" "wf (r - Id)" |
63167 | 201 |
using \<open>Well_order r\<close> by (simp_all add: order_on_defs) |
202 |
have "refl_on A ?r" using \<open>Refl r\<close> by (auto simp: refl_on_def univ) |
|
203 |
moreover have "trans ?r" using \<open>trans r\<close> |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
204 |
unfolding trans_def by blast |
63167 | 205 |
moreover have "antisym ?r" using \<open>antisym r\<close> |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
206 |
unfolding antisym_def by blast |
63167 | 207 |
moreover have "total_on A ?r" using \<open>Total r\<close> by (simp add: total_on_def univ) |
208 |
moreover have "wf (?r - Id)" by (rule wf_subset [OF \<open>wf(r - Id)\<close>]) blast |
|
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
209 |
ultimately have "well_order_on A ?r" by (simp add: order_on_defs) |
63167 | 210 |
with \<open>p \<subseteq> ?r\<close> show ?thesis by blast |
54545
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
211 |
qed |
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
212 |
|
483131676087
effectively reverted d25fc4c0ff62, to avoid quasi-cyclic dependencies with HOL-Cardinals and minimize BNF dependencies
blanchet
parents:
diff
changeset
|
213 |
end |