author | blanchet |
Thu, 20 Nov 2014 17:29:18 +0100 | |
changeset 59018 | ec8ea2465d2a |
parent 58889 | 5b7a9633cfa8 |
child 61068 | 6cb92c2a5ece |
permissions | -rw-r--r-- |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1 |
(* Title: HOL/Cardinals/Ordinal_Arithmetic.thy |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
2 |
Author: Dmitriy Traytel, TU Muenchen |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
3 |
Copyright 2014 |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
4 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
5 |
Ordinal arithmetic. |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
6 |
*) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
7 |
|
58889 | 8 |
section {* Ordinal Arithmetic *} |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
9 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
10 |
theory Ordinal_Arithmetic |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
11 |
imports Wellorder_Constructions |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
12 |
begin |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
13 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
14 |
definition osum :: "'a rel \<Rightarrow> 'b rel \<Rightarrow> ('a + 'b) rel" (infixr "+o" 70) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
15 |
where |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
16 |
"r +o r' = map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
17 |
{(Inl a, Inr a') | a a' . a \<in> Field r \<and> a' \<in> Field r'}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
18 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
19 |
lemma Field_osum: "Field(r +o r') = Inl ` Field r \<union> Inr ` Field r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
20 |
unfolding osum_def Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
21 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
22 |
lemma osum_Refl:"\<lbrakk>Refl r; Refl r'\<rbrakk> \<Longrightarrow> Refl (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
23 |
(*Need first unfold Field_osum, only then osum_def*) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
24 |
unfolding refl_on_def Field_osum unfolding osum_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
25 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
26 |
lemma osum_trans: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
27 |
assumes TRANS: "trans r" and TRANS': "trans r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
28 |
shows "trans (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
29 |
proof(unfold trans_def, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
30 |
fix x y z assume *: "(x, y) \<in> r +o r'" "(y, z) \<in> r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
31 |
thus "(x, z) \<in> r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
32 |
proof (cases x y z rule: sum.exhaust[case_product sum.exhaust sum.exhaust]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
33 |
case (Inl_Inl_Inl a b c) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
34 |
with * have "(a,b) \<in> r" "(b,c) \<in> r" unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
35 |
with TRANS have "(a,c) \<in> r" unfolding trans_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
36 |
with Inl_Inl_Inl show ?thesis unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
37 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
38 |
case (Inl_Inl_Inr a b c) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
39 |
with * have "a \<in> Field r" "c \<in> Field r'" unfolding osum_def Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
40 |
with Inl_Inl_Inr show ?thesis unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
41 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
42 |
case (Inl_Inr_Inr a b c) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
43 |
with * have "a \<in> Field r" "c \<in> Field r'" unfolding osum_def Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
44 |
with Inl_Inr_Inr show ?thesis unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
45 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
46 |
case (Inr_Inr_Inr a b c) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
47 |
with * have "(a,b) \<in> r'" "(b,c) \<in> r'" unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
48 |
with TRANS' have "(a,c) \<in> r'" unfolding trans_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
49 |
with Inr_Inr_Inr show ?thesis unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
50 |
qed (auto simp: osum_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
51 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
52 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
53 |
lemma osum_Preorder: "\<lbrakk>Preorder r; Preorder r'\<rbrakk> \<Longrightarrow> Preorder (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
54 |
unfolding preorder_on_def using osum_Refl osum_trans by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
55 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
56 |
lemma osum_antisym: "\<lbrakk>antisym r; antisym r'\<rbrakk> \<Longrightarrow> antisym (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
57 |
unfolding antisym_def osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
58 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
59 |
lemma osum_Partial_order: "\<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
60 |
unfolding partial_order_on_def using osum_Preorder osum_antisym by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
61 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
62 |
lemma osum_Total: "\<lbrakk>Total r; Total r'\<rbrakk> \<Longrightarrow> Total (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
63 |
unfolding total_on_def Field_osum unfolding osum_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
64 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
65 |
lemma osum_Linear_order: "\<lbrakk>Linear_order r; Linear_order r'\<rbrakk> \<Longrightarrow> Linear_order (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
66 |
unfolding linear_order_on_def using osum_Partial_order osum_Total by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
67 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
68 |
lemma osum_wf: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
69 |
assumes WF: "wf r" and WF': "wf r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
70 |
shows "wf (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
71 |
unfolding wf_eq_minimal2 unfolding Field_osum |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
72 |
proof(intro allI impI, elim conjE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
73 |
fix A assume *: "A \<subseteq> Inl ` Field r \<union> Inr ` Field r'" and **: "A \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
74 |
obtain B where B_def: "B = A Int Inl ` Field r" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
75 |
show "\<exists>a\<in>A. \<forall>a'\<in>A. (a', a) \<notin> r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
76 |
proof(cases "B = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
77 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
78 |
hence "B \<noteq> {}" "B \<le> Inl ` Field r" using B_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
79 |
hence "Inl -` B \<noteq> {}" "Inl -` B \<le> Field r" unfolding vimage_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
80 |
then obtain a where 1: "a \<in> Inl -` B" and "\<forall>a1 \<in> Inl -` B. (a1, a) \<notin> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
81 |
using WF unfolding wf_eq_minimal2 by metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
82 |
hence "\<forall>a1 \<in> A. (a1, Inl a) \<notin> r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
83 |
unfolding osum_def using B_def ** by (auto simp: vimage_def Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
84 |
thus ?thesis using 1 unfolding B_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
85 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
86 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
87 |
hence 1: "A \<le> Inr ` Field r'" using * B_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
88 |
with ** have "Inr -`A \<noteq> {}" "Inr -` A \<le> Field r'" unfolding vimage_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
89 |
with ** obtain a' where 2: "a' \<in> Inr -` A" and "\<forall>a1' \<in> Inr -` A. (a1',a') \<notin> r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
90 |
using WF' unfolding wf_eq_minimal2 by metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
91 |
hence "\<forall>a1' \<in> A. (a1', Inr a') \<notin> r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
92 |
unfolding osum_def using ** 1 by (auto simp: vimage_def Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
93 |
thus ?thesis using 2 by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
94 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
95 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
96 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
97 |
lemma osum_minus_Id: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
98 |
assumes r: "Total r" "\<not> (r \<le> Id)" and r': "Total r'" "\<not> (r' \<le> Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
99 |
shows "(r +o r') - Id \<le> (r - Id) +o (r' - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
100 |
unfolding osum_def Total_Id_Field[OF r] Total_Id_Field[OF r'] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
101 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
102 |
lemma osum_minus_Id1: |
55932 | 103 |
"r \<le> Id \<Longrightarrow> (r +o r') - Id \<le> (Inl ` Field r \<times> Inr ` Field r') \<union> (map_prod Inr Inr ` (r' - Id))" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
104 |
unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
105 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
106 |
lemma osum_minus_Id2: |
55932 | 107 |
"r' \<le> Id \<Longrightarrow> (r +o r') - Id \<le> (map_prod Inl Inl ` (r - Id)) \<union> (Inl ` Field r \<times> Inr ` Field r')" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
108 |
unfolding osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
109 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
110 |
lemma osum_wf_Id: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
111 |
assumes TOT: "Total r" and TOT': "Total r'" and WF: "wf(r - Id)" and WF': "wf(r' - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
112 |
shows "wf ((r +o r') - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
113 |
proof(cases "r \<le> Id \<or> r' \<le> Id") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
114 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
115 |
thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
116 |
using osum_minus_Id[of r r'] assms osum_wf[of "r - Id" "r' - Id"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
117 |
wf_subset[of "(r - Id) +o (r' - Id)" "(r +o r') - Id"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
118 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
119 |
have 1: "wf (Inl ` Field r \<times> Inr ` Field r')" by (rule wf_Int_Times) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
120 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
121 |
thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
122 |
proof (elim disjE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
123 |
assume "r \<subseteq> Id" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
124 |
thus "wf ((r +o r') - Id)" |
55932 | 125 |
by (rule wf_subset[rotated, OF osum_minus_Id1 wf_Un[OF 1 wf_map_prod_image[OF WF']]]) auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
126 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
127 |
assume "r' \<subseteq> Id" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
128 |
thus "wf ((r +o r') - Id)" |
55932 | 129 |
by (rule wf_subset[rotated, OF osum_minus_Id2 wf_Un[OF wf_map_prod_image[OF WF] 1]]) auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
130 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
131 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
132 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
133 |
lemma osum_Well_order: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
134 |
assumes WELL: "Well_order r" and WELL': "Well_order r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
135 |
shows "Well_order (r +o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
136 |
proof- |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
137 |
have "Total r \<and> Total r'" using WELL WELL' by (auto simp add: order_on_defs) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
138 |
thus ?thesis using assms unfolding well_order_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
139 |
using osum_Linear_order osum_wf_Id by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
140 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
141 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
142 |
lemma osum_embedL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
143 |
assumes WELL: "Well_order r" and WELL': "Well_order r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
144 |
shows "embed r (r +o r') Inl" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
145 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
146 |
have 1: "Well_order (r +o r')" using assms by (auto simp add: osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
147 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
148 |
have "compat r (r +o r') Inl" unfolding compat_def osum_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
149 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
150 |
have "ofilter (r +o r') (Inl ` Field r)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
151 |
unfolding wo_rel.ofilter_def[unfolded wo_rel_def, OF 1] Field_osum under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
152 |
unfolding osum_def Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
153 |
ultimately show ?thesis using assms by (auto simp add: embed_iff_compat_inj_on_ofilter) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
154 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
155 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
156 |
corollary osum_ordLeqL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
157 |
assumes WELL: "Well_order r" and WELL': "Well_order r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
158 |
shows "r \<le>o r +o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
159 |
using assms osum_embedL osum_Well_order unfolding ordLeq_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
160 |
|
55932 | 161 |
lemma dir_image_alt: "dir_image r f = map_prod f f ` r" |
162 |
unfolding dir_image_def map_prod_def by auto |
|
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
163 |
|
55932 | 164 |
lemma map_prod_ordIso: "\<lbrakk>Well_order r; inj_on f (Field r)\<rbrakk> \<Longrightarrow> map_prod f f ` r =o r" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
165 |
unfolding dir_image_alt[symmetric] by (rule ordIso_symmetric[OF dir_image_ordIso]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
166 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
167 |
definition oprod :: "'a rel \<Rightarrow> 'b rel \<Rightarrow> ('a \<times> 'b) rel" (infixr "*o" 80) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
168 |
where "r *o r' = {((x1, y1), (x2, y2)). |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
169 |
(((y1, y2) \<in> r' - Id \<and> x1 \<in> Field r \<and> x2 \<in> Field r) \<or> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
170 |
((y1, y2) \<in> Restr Id (Field r') \<and> (x1, x2) \<in> r))}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
171 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
172 |
lemma Field_oprod: "Field (r *o r') = Field r \<times> Field r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
173 |
unfolding oprod_def Field_def by auto blast+ |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
174 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
175 |
lemma oprod_Refl:"\<lbrakk>Refl r; Refl r'\<rbrakk> \<Longrightarrow> Refl (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
176 |
unfolding refl_on_def Field_oprod unfolding oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
177 |
|
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
178 |
lemma oprod_trans: |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
179 |
assumes "trans r" "trans r'" "antisym r" "antisym r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
180 |
shows "trans (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
181 |
proof(unfold trans_def, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
182 |
fix x y z assume *: "(x, y) \<in> r *o r'" "(y, z) \<in> r *o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
183 |
thus "(x, z) \<in> r *o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
184 |
unfolding oprod_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
185 |
apply safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
186 |
apply (metis assms(2) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
187 |
apply (metis assms(2) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
188 |
apply (metis assms(2) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
189 |
apply (metis assms(4) antisymD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
190 |
apply (metis assms(4) antisymD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
191 |
apply (metis assms(2) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
192 |
apply (metis assms(4) antisymD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
193 |
apply (metis Field_def Range_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
194 |
apply (metis Field_def Range_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
195 |
apply (metis Field_def Range_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
196 |
apply (metis Field_def Domain_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
197 |
apply (metis Field_def Domain_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
198 |
apply (metis Field_def Domain_iff Un_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
199 |
apply (metis assms(1) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
200 |
apply (metis assms(1) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
201 |
apply (metis assms(1) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
202 |
apply (metis assms(1) transE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
203 |
done |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
204 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
205 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
206 |
lemma oprod_Preorder: "\<lbrakk>Preorder r; Preorder r'; antisym r; antisym r'\<rbrakk> \<Longrightarrow> Preorder (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
207 |
unfolding preorder_on_def using oprod_Refl oprod_trans by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
208 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
209 |
lemma oprod_antisym: "\<lbrakk>antisym r; antisym r'\<rbrakk> \<Longrightarrow> antisym (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
210 |
unfolding antisym_def oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
211 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
212 |
lemma oprod_Partial_order: "\<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
213 |
unfolding partial_order_on_def using oprod_Preorder oprod_antisym by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
214 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
215 |
lemma oprod_Total: "\<lbrakk>Total r; Total r'\<rbrakk> \<Longrightarrow> Total (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
216 |
unfolding total_on_def Field_oprod unfolding oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
217 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
218 |
lemma oprod_Linear_order: "\<lbrakk>Linear_order r; Linear_order r'\<rbrakk> \<Longrightarrow> Linear_order (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
219 |
unfolding linear_order_on_def using oprod_Partial_order oprod_Total by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
220 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
221 |
lemma oprod_wf: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
222 |
assumes WF: "wf r" and WF': "wf r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
223 |
shows "wf (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
224 |
unfolding wf_eq_minimal2 unfolding Field_oprod |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
225 |
proof(intro allI impI, elim conjE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
226 |
fix A assume *: "A \<subseteq> Field r \<times> Field r'" and **: "A \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
227 |
then obtain y where y: "y \<in> snd ` A" "\<forall>y'\<in>snd ` A. (y', y) \<notin> r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
228 |
using spec[OF WF'[unfolded wf_eq_minimal2], of "snd ` A"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
229 |
let ?A = "fst ` A \<inter> {x. (x, y) \<in> A}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
230 |
from * y have "?A \<noteq> {}" "?A \<subseteq> Field r" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
231 |
then obtain x where x: "x \<in> ?A" and "\<forall>x'\<in> ?A. (x', x) \<notin> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
232 |
using spec[OF WF[unfolded wf_eq_minimal2], of "?A"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
233 |
with y have "\<forall>a'\<in>A. (a', (x, y)) \<notin> r *o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
234 |
unfolding oprod_def mem_Collect_eq split_beta fst_conv snd_conv Id_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
235 |
moreover from x have "(x, y) \<in> A" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
236 |
ultimately show "\<exists>a\<in>A. \<forall>a'\<in>A. (a', a) \<notin> r *o r'" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
237 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
238 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
239 |
lemma oprod_minus_Id: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
240 |
assumes r: "Total r" "\<not> (r \<le> Id)" and r': "Total r'" "\<not> (r' \<le> Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
241 |
shows "(r *o r') - Id \<le> (r - Id) *o (r' - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
242 |
unfolding oprod_def Total_Id_Field[OF r] Total_Id_Field[OF r'] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
243 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
244 |
lemma oprod_minus_Id1: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
245 |
"r \<le> Id \<Longrightarrow> r *o r' - Id \<le> {((x,y1), (x,y2)). x \<in> Field r \<and> (y1, y2) \<in> (r' - Id)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
246 |
unfolding oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
247 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
248 |
lemma wf_extend_oprod1: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
249 |
assumes "wf r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
250 |
shows "wf {((x,y1), (x,y2)) . x \<in> A \<and> (y1, y2) \<in> r}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
251 |
proof (unfold wf_eq_minimal2, intro allI impI, elim conjE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
252 |
fix B |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
253 |
assume *: "B \<subseteq> Field {((x,y1), (x,y2)) . x \<in> A \<and> (y1, y2) \<in> r}" and "B \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
254 |
from image_mono[OF *, of snd] have "snd ` B \<subseteq> Field r" unfolding Field_def by force |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
255 |
with `B \<noteq> {}` obtain x where x: "x \<in> snd ` B" "\<forall>x'\<in>snd ` B. (x', x) \<notin> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
256 |
using spec[OF assms[unfolded wf_eq_minimal2], of "snd ` B"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
257 |
then obtain a where "(a, x) \<in> B" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
258 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
259 |
from * x have "\<forall>a'\<in>B. (a', (a, x)) \<notin> {((x,y1), (x,y2)) . x \<in> A \<and> (y1, y2) \<in> r}" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
260 |
ultimately show "\<exists>ax\<in>B. \<forall>a'\<in>B. (a', ax) \<notin> {((x,y1), (x,y2)) . x \<in> A \<and> (y1, y2) \<in> r}" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
261 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
262 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
263 |
lemma oprod_minus_Id2: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
264 |
"r' \<le> Id \<Longrightarrow> r *o r' - Id \<le> {((x1,y), (x2,y)). (x1, x2) \<in> (r - Id) \<and> y \<in> Field r'}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
265 |
unfolding oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
266 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
267 |
lemma wf_extend_oprod2: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
268 |
assumes "wf r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
269 |
shows "wf {((x1,y), (x2,y)) . (x1, x2) \<in> r \<and> y \<in> A}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
270 |
proof (unfold wf_eq_minimal2, intro allI impI, elim conjE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
271 |
fix B |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
272 |
assume *: "B \<subseteq> Field {((x1, y), (x2, y)). (x1, x2) \<in> r \<and> y \<in> A}" and "B \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
273 |
from image_mono[OF *, of fst] have "fst ` B \<subseteq> Field r" unfolding Field_def by force |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
274 |
with `B \<noteq> {}` obtain x where x: "x \<in> fst ` B" "\<forall>x'\<in>fst ` B. (x', x) \<notin> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
275 |
using spec[OF assms[unfolded wf_eq_minimal2], of "fst ` B"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
276 |
then obtain a where "(x, a) \<in> B" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
277 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
278 |
from * x have "\<forall>a'\<in>B. (a', (x, a)) \<notin> {((x1, y), x2, y). (x1, x2) \<in> r \<and> y \<in> A}" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
279 |
ultimately show "\<exists>xa\<in>B. \<forall>a'\<in>B. (a', xa) \<notin> {((x1, y), x2, y). (x1, x2) \<in> r \<and> y \<in> A}" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
280 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
281 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
282 |
lemma oprod_wf_Id: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
283 |
assumes TOT: "Total r" and TOT': "Total r'" and WF: "wf(r - Id)" and WF': "wf(r' - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
284 |
shows "wf ((r *o r') - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
285 |
proof(cases "r \<le> Id \<or> r' \<le> Id") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
286 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
287 |
thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
288 |
using oprod_minus_Id[of r r'] assms oprod_wf[of "r - Id" "r' - Id"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
289 |
wf_subset[of "(r - Id) *o (r' - Id)" "(r *o r') - Id"] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
290 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
291 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
292 |
thus ?thesis using wf_subset[OF wf_extend_oprod1[OF WF'] oprod_minus_Id1] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
293 |
wf_subset[OF wf_extend_oprod2[OF WF] oprod_minus_Id2] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
294 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
295 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
296 |
lemma oprod_Well_order: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
297 |
assumes WELL: "Well_order r" and WELL': "Well_order r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
298 |
shows "Well_order (r *o r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
299 |
proof- |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
300 |
have "Total r \<and> Total r'" using WELL WELL' by (auto simp add: order_on_defs) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
301 |
thus ?thesis using assms unfolding well_order_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
302 |
using oprod_Linear_order oprod_wf_Id by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
303 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
304 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
305 |
lemma oprod_embed: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
306 |
assumes WELL: "Well_order r" and WELL': "Well_order r'" and "r' \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
307 |
shows "embed r (r *o r') (\<lambda>x. (x, minim r' (Field r')))" (is "embed _ _ ?f") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
308 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
309 |
from assms(3) have r': "Field r' \<noteq> {}" unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
310 |
have minim[simp]: "minim r' (Field r') \<in> Field r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
311 |
using wo_rel.minim_inField[unfolded wo_rel_def, OF WELL' _ r'] by auto |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
312 |
{ fix b |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
313 |
assume "(b, minim r' (Field r')) \<in> r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
314 |
moreover hence "b \<in> Field r'" unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
315 |
hence "(minim r' (Field r'), b) \<in> r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
316 |
using wo_rel.minim_least[unfolded wo_rel_def, OF WELL' subset_refl] r' by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
317 |
ultimately have "b = minim r' (Field r')" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
318 |
by (metis WELL' antisym_def linear_order_on_def partial_order_on_def well_order_on_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
319 |
} note * = this |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
320 |
have 1: "Well_order (r *o r')" using assms by (auto simp add: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
321 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
322 |
from r' have "compat r (r *o r') ?f" unfolding compat_def oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
323 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
324 |
from * have "ofilter (r *o r') (?f ` Field r)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
325 |
unfolding wo_rel.ofilter_def[unfolded wo_rel_def, OF 1] Field_oprod under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
326 |
unfolding oprod_def by auto (auto simp: image_iff Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
327 |
moreover have "inj_on ?f (Field r)" unfolding inj_on_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
328 |
ultimately show ?thesis using assms by (auto simp add: embed_iff_compat_inj_on_ofilter) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
329 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
330 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
331 |
corollary oprod_ordLeq: "\<lbrakk>Well_order r; Well_order r'; r' \<noteq> {}\<rbrakk> \<Longrightarrow> r \<le>o r *o r'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
332 |
using oprod_embed oprod_Well_order unfolding ordLeq_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
333 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
334 |
definition "support z A f = {x \<in> A. f x \<noteq> z}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
335 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
336 |
lemma support_Un[simp]: "support z (A \<union> B) f = support z A f \<union> support z B f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
337 |
unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
338 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
339 |
lemma support_upd[simp]: "support z A (f(x := z)) = support z A f - {x}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
340 |
unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
341 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
342 |
lemma support_upd_subset[simp]: "support z A (f(x := y)) \<subseteq> support z A f \<union> {x}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
343 |
unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
344 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
345 |
lemma fun_unequal_in_support: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
346 |
assumes "f \<noteq> g" "f \<in> Func A B" "g \<in> Func A C" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
347 |
shows "(support z A f \<union> support z A g) \<inter> {a. f a \<noteq> g a} \<noteq> {}" (is "?L \<inter> ?R \<noteq> {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
348 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
349 |
from assms(1) obtain x where x: "f x \<noteq> g x" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
350 |
hence "x \<in> ?R" by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
351 |
moreover from assms(2-3) x have "x \<in> A" unfolding Func_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
352 |
with x have "x \<in> ?L" unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
353 |
ultimately show ?thesis by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
354 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
355 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
356 |
definition fin_support where |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
357 |
"fin_support z A = {f. finite (support z A f)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
358 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
359 |
lemma finite_support: "f \<in> fin_support z A \<Longrightarrow> finite (support z A f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
360 |
unfolding support_def fin_support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
361 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
362 |
lemma fin_support_Field_osum: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
363 |
"f \<in> fin_support z (Inl ` A \<union> Inr ` B) \<longleftrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
364 |
(f o Inl) \<in> fin_support z A \<and> (f o Inr) \<in> fin_support z B" (is "?L \<longleftrightarrow> ?R1 \<and> ?R2") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
365 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
366 |
assume ?L |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
367 |
from `?L` show ?R1 unfolding fin_support_def support_def |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
368 |
by (fastforce simp: image_iff elim: finite_surj[of _ _ "case_sum id undefined"]) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
369 |
from `?L` show ?R2 unfolding fin_support_def support_def |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
370 |
by (fastforce simp: image_iff elim: finite_surj[of _ _ "case_sum undefined id"]) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
371 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
372 |
assume ?R1 ?R2 |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
373 |
thus ?L unfolding fin_support_def support_Un |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
374 |
by (auto simp: support_def elim: finite_surj[of _ _ Inl] finite_surj[of _ _ Inr]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
375 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
376 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
377 |
lemma Func_upd: "\<lbrakk>f \<in> Func A B; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> f(x := y) \<in> Func A B" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
378 |
unfolding Func_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
379 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
380 |
context wo_rel |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
381 |
begin |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
382 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
383 |
definition isMaxim :: "'a set \<Rightarrow> 'a \<Rightarrow> bool" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
384 |
where "isMaxim A b \<equiv> b \<in> A \<and> (\<forall>a \<in> A. (a,b) \<in> r)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
385 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
386 |
definition maxim :: "'a set \<Rightarrow> 'a" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
387 |
where "maxim A \<equiv> THE b. isMaxim A b" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
388 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
389 |
lemma isMaxim_unique[intro]: "\<lbrakk>isMaxim A x; isMaxim A y\<rbrakk> \<Longrightarrow> x = y" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
390 |
unfolding isMaxim_def using antisymD[OF ANTISYM, of x y] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
391 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
392 |
lemma maxim_isMaxim: "\<lbrakk>finite A; A \<noteq> {}; A \<subseteq> Field r\<rbrakk> \<Longrightarrow> isMaxim A (maxim A)" |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
393 |
unfolding maxim_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
394 |
proof (rule theI', rule ex_ex1I[OF _ isMaxim_unique, rotated], assumption+, |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
395 |
induct A rule: finite_induct) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
396 |
case (insert x A) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
397 |
thus ?case |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
398 |
proof (cases "A = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
399 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
400 |
moreover have "isMaxim {x} x" unfolding isMaxim_def using refl_onD[OF REFL] insert(5) by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
401 |
ultimately show ?thesis by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
402 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
403 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
404 |
with insert(3,5) obtain y where "isMaxim A y" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
405 |
with insert(2,5) have "if (y, x) \<in> r then isMaxim (insert x A) x else isMaxim (insert x A) y" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
406 |
unfolding isMaxim_def subset_eq by (metis insert_iff max2_def max2_equals1 max2_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
407 |
thus ?thesis by metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
408 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
409 |
qed simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
410 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
411 |
lemma maxim_in: "\<lbrakk>finite A; A \<noteq> {}; A \<subseteq> Field r\<rbrakk> \<Longrightarrow> maxim A \<in> A" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
412 |
using maxim_isMaxim unfolding isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
413 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
414 |
lemma maxim_greatest: "\<lbrakk>finite A; x \<in> A; A \<subseteq> Field r\<rbrakk> \<Longrightarrow> (x, maxim A) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
415 |
using maxim_isMaxim unfolding isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
416 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
417 |
lemma isMaxim_zero: "isMaxim A zero \<Longrightarrow> A = {zero}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
418 |
unfolding isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
419 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
420 |
lemma maxim_insert: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
421 |
assumes "finite A" "A \<noteq> {}" "A \<subseteq> Field r" "x \<in> Field r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
422 |
shows "maxim (insert x A) = max2 x (maxim A)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
423 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
424 |
from assms have *: "isMaxim (insert x A) (maxim (insert x A))" "isMaxim A (maxim A)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
425 |
using maxim_isMaxim by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
426 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
427 |
proof (cases "(x, maxim A) \<in> r") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
428 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
429 |
with *(2) have "isMaxim (insert x A) (maxim A)" unfolding isMaxim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
430 |
using transD[OF TRANS, of _ x "maxim A"] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
431 |
with *(1) True show ?thesis unfolding max2_def by (metis isMaxim_unique) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
432 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
433 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
434 |
hence "(maxim A, x) \<in> r" by (metis *(2) assms(3,4) in_mono in_notinI isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
435 |
with *(2) assms(4) have "isMaxim (insert x A) x" unfolding isMaxim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
436 |
using transD[OF TRANS, of _ "maxim A" x] refl_onD[OF REFL, of x] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
437 |
with *(1) False show ?thesis unfolding max2_def by (metis isMaxim_unique) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
438 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
439 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
440 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
441 |
lemma maxim_Un: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
442 |
assumes "finite A" "A \<noteq> {}" "A \<subseteq> Field r" "finite B" "B \<noteq> {}" "B \<subseteq> Field r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
443 |
shows "maxim (A \<union> B) = max2 (maxim A) (maxim B)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
444 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
445 |
from assms have *: "isMaxim (A \<union> B) (maxim (A \<union> B))" "isMaxim A (maxim A)" "isMaxim B (maxim B)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
446 |
using maxim_isMaxim by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
447 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
448 |
proof (cases "(maxim A, maxim B) \<in> r") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
449 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
450 |
with *(2,3) have "isMaxim (A \<union> B) (maxim B)" unfolding isMaxim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
451 |
using transD[OF TRANS, of _ "maxim A" "maxim B"] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
452 |
with *(1) True show ?thesis unfolding max2_def by (metis isMaxim_unique) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
453 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
454 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
455 |
hence "(maxim B, maxim A) \<in> r" by (metis *(2,3) assms(3,6) in_mono in_notinI isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
456 |
with *(2,3) have "isMaxim (A \<union> B) (maxim A)" unfolding isMaxim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
457 |
using transD[OF TRANS, of _ "maxim B" "maxim A"] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
458 |
with *(1) False show ?thesis unfolding max2_def by (metis isMaxim_unique) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
459 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
460 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
461 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
462 |
lemma maxim_insert_zero: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
463 |
assumes "finite A" "A \<noteq> {}" "A \<subseteq> Field r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
464 |
shows "maxim (insert zero A) = maxim A" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
465 |
using assms zero_in_Field maxim_in[OF assms] by (subst maxim_insert[unfolded max2_def]) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
466 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
467 |
lemma maxim_equality: "isMaxim A x \<Longrightarrow> maxim A = x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
468 |
unfolding maxim_def by (rule the_equality) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
469 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
470 |
lemma maxim_singleton: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
471 |
"x \<in> Field r \<Longrightarrow> maxim {x} = x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
472 |
using refl_onD[OF REFL] by (intro maxim_equality) (simp add: isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
473 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
474 |
lemma maxim_Int: "\<lbrakk>finite A; A \<noteq> {}; A \<subseteq> Field r; maxim A \<in> B\<rbrakk> \<Longrightarrow> maxim (A \<inter> B) = maxim A" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
475 |
by (rule maxim_equality) (auto simp: isMaxim_def intro: maxim_in maxim_greatest) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
476 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
477 |
lemma maxim_mono: "\<lbrakk>X \<subseteq> Y; finite Y; X \<noteq> {}; Y \<subseteq> Field r\<rbrakk> \<Longrightarrow> (maxim X, maxim Y) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
478 |
using maxim_in[OF finite_subset, of X Y] by (auto intro: maxim_greatest) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
479 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
480 |
definition "max_fun_diff f g \<equiv> maxim ({a \<in> Field r. f a \<noteq> g a})" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
481 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
482 |
lemma max_fun_diff_commute: "max_fun_diff f g = max_fun_diff g f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
483 |
unfolding max_fun_diff_def by metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
484 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
485 |
lemma zero_under: "x \<in> Field r \<Longrightarrow> zero \<in> under x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
486 |
unfolding under_def by (auto intro: zero_smallest) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
487 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
488 |
end |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
489 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
490 |
definition "FinFunc r s = Func (Field s) (Field r) \<inter> fin_support (zero r) (Field s)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
491 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
492 |
lemma FinFuncD: "\<lbrakk>f \<in> FinFunc r s; x \<in> Field s\<rbrakk> \<Longrightarrow> f x \<in> Field r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
493 |
unfolding FinFunc_def Func_def by (fastforce split: option.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
494 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
495 |
locale wo_rel2 = |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
496 |
fixes r s |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
497 |
assumes rWELL: "Well_order r" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
498 |
and sWELL: "Well_order s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
499 |
begin |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
500 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
501 |
interpretation r!: wo_rel r by unfold_locales (rule rWELL) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
502 |
interpretation s!: wo_rel s by unfold_locales (rule sWELL) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
503 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
504 |
abbreviation "SUPP \<equiv> support r.zero (Field s)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
505 |
abbreviation "FINFUNC \<equiv> FinFunc r s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
506 |
lemmas FINFUNCD = FinFuncD[of _ r s] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
507 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
508 |
lemma fun_diff_alt: "{a \<in> Field s. f a \<noteq> g a} = (SUPP f \<union> SUPP g) \<inter> {a. f a \<noteq> g a}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
509 |
by (auto simp: support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
510 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
511 |
lemma max_fun_diff_alt: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
512 |
"s.max_fun_diff f g = s.maxim ((SUPP f \<union> SUPP g) \<inter> {a. f a \<noteq> g a})" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
513 |
unfolding s.max_fun_diff_def fun_diff_alt .. |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
514 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
515 |
lemma isMaxim_max_fun_diff: "\<lbrakk>f \<noteq> g; f \<in> FINFUNC; g \<in> FINFUNC\<rbrakk> \<Longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
516 |
s.isMaxim {a \<in> Field s. f a \<noteq> g a} (s.max_fun_diff f g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
517 |
using fun_unequal_in_support[of f g] unfolding max_fun_diff_alt fun_diff_alt fun_eq_iff |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
518 |
by (intro s.maxim_isMaxim) (auto simp: FinFunc_def fin_support_def support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
519 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
520 |
lemma max_fun_diff_in: "\<lbrakk>f \<noteq> g; f \<in> FINFUNC; g \<in> FINFUNC\<rbrakk> \<Longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
521 |
s.max_fun_diff f g \<in> {a \<in> Field s. f a \<noteq> g a}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
522 |
using isMaxim_max_fun_diff unfolding s.isMaxim_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
523 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
524 |
lemma max_fun_diff_max: "\<lbrakk>f \<noteq> g; f \<in> FINFUNC; g \<in> FINFUNC; x \<in> {a \<in> Field s. f a \<noteq> g a}\<rbrakk> \<Longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
525 |
(x, s.max_fun_diff f g) \<in> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
526 |
using isMaxim_max_fun_diff unfolding s.isMaxim_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
527 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
528 |
lemma max_fun_diff: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
529 |
"\<lbrakk>f \<noteq> g; f \<in> FINFUNC; g \<in> FINFUNC\<rbrakk> \<Longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
530 |
(\<exists>a b. a \<noteq> b \<and> a \<in> Field r \<and> b \<in> Field r \<and> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
531 |
f (s.max_fun_diff f g) = a \<and> g (s.max_fun_diff f g) = b)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
532 |
using isMaxim_max_fun_diff[of f g] unfolding s.isMaxim_def FinFunc_def Func_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
533 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
534 |
lemma max_fun_diff_le_eq: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
535 |
"\<lbrakk>(s.max_fun_diff f g, x) \<in> s; f \<noteq> g; f \<in> FINFUNC; g \<in> FINFUNC; x \<noteq> s.max_fun_diff f g\<rbrakk> \<Longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
536 |
f x = g x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
537 |
using max_fun_diff_max[of f g x] antisymD[OF s.ANTISYM, of "s.max_fun_diff f g" x] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
538 |
by (auto simp: Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
539 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
540 |
lemma max_fun_diff_max2: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
541 |
assumes ineq: "s.max_fun_diff f g = s.max_fun_diff g h \<longrightarrow> |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
542 |
f (s.max_fun_diff f g) \<noteq> h (s.max_fun_diff g h)" and |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
543 |
fg: "f \<noteq> g" and gh: "g \<noteq> h" and fh: "f \<noteq> h" and |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
544 |
f: "f \<in> FINFUNC" and g: "g \<in> FINFUNC" and h: "h \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
545 |
shows "s.max_fun_diff f h = s.max2 (s.max_fun_diff f g) (s.max_fun_diff g h)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
546 |
(is "?fh = s.max2 ?fg ?gh") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
547 |
proof (cases "?fg = ?gh") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
548 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
549 |
with ineq have "f ?fg \<noteq> h ?fg" by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
550 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
551 |
{ fix x assume x: "x \<in> {a \<in> Field s. f a \<noteq> h a}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
552 |
hence "(x, ?fg) \<in> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
553 |
proof (cases "x = ?fg") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
554 |
case False show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
555 |
proof (rule ccontr) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
556 |
assume "(x, ?fg) \<notin> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
557 |
with max_fun_diff_in[OF fg f g] x False have *: "(?fg, x) \<in> s" by (blast intro: s.in_notinI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
558 |
hence "f x = g x" by (rule max_fun_diff_le_eq[OF _ fg f g False]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
559 |
moreover have "g x = h x" using max_fun_diff_le_eq[OF _ gh g h] False True * by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
560 |
ultimately show False using x by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
561 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
562 |
qed (simp add: refl_onD[OF s.REFL]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
563 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
564 |
ultimately have "s.isMaxim {a \<in> Field s. f a \<noteq> h a} ?fg" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
565 |
unfolding s.isMaxim_def using max_fun_diff_in[OF fg f g] by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
566 |
hence "?fh = ?fg" using isMaxim_max_fun_diff[OF fh f h] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
567 |
thus ?thesis unfolding True s.max2_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
568 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
569 |
case False note * = this |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
570 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
571 |
proof (cases "(?fg, ?gh) \<in> s") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
572 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
573 |
hence *: "f ?gh = g ?gh" by (rule max_fun_diff_le_eq[OF _ fg f g *[symmetric]]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
574 |
hence "s.isMaxim {a \<in> Field s. f a \<noteq> h a} ?gh" using isMaxim_max_fun_diff[OF gh g h] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
575 |
isMaxim_max_fun_diff[OF fg f g] transD[OF s.TRANS _ True] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
576 |
unfolding s.isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
577 |
hence "?fh = ?gh" using isMaxim_max_fun_diff[OF fh f h] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
578 |
thus ?thesis using True unfolding s.max2_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
579 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
580 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
581 |
with max_fun_diff_in[OF fg f g] max_fun_diff_in[OF gh g h] have True: "(?gh, ?fg) \<in> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
582 |
by (blast intro: s.in_notinI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
583 |
hence *: "g ?fg = h ?fg" by (rule max_fun_diff_le_eq[OF _ gh g h *]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
584 |
hence "s.isMaxim {a \<in> Field s. f a \<noteq> h a} ?fg" using isMaxim_max_fun_diff[OF gh g h] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
585 |
isMaxim_max_fun_diff[OF fg f g] True transD[OF s.TRANS, of _ _ ?fg] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
586 |
unfolding s.isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
587 |
hence "?fh = ?fg" using isMaxim_max_fun_diff[OF fh f h] by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
588 |
thus ?thesis using False unfolding s.max2_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
589 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
590 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
591 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
592 |
definition oexp where |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
593 |
"oexp = {(f, g) . f \<in> FINFUNC \<and> g \<in> FINFUNC \<and> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
594 |
((let m = s.max_fun_diff f g in (f m, g m) \<in> r) \<or> f = g)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
595 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
596 |
lemma Field_oexp: "Field oexp = FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
597 |
unfolding oexp_def FinFunc_def by (auto simp: Let_def Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
598 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
599 |
lemma oexp_Refl: "Refl oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
600 |
unfolding refl_on_def Field_oexp unfolding oexp_def by (auto simp: Let_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
601 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
602 |
lemma oexp_trans: "trans oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
603 |
proof (unfold trans_def, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
604 |
fix f g h :: "'b \<Rightarrow> 'a" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
605 |
let ?fg = "s.max_fun_diff f g" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
606 |
and ?gh = "s.max_fun_diff g h" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
607 |
and ?fh = "s.max_fun_diff f h" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
608 |
assume oexp: "(f, g) \<in> oexp" "(g, h) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
609 |
thus "(f, h) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
610 |
proof (cases "f = g \<or> g = h") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
611 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
612 |
with oexp have "f \<in> FINFUNC" "g \<in> FINFUNC" "h \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
613 |
"(f ?fg, g ?fg) \<in> r" "(g ?gh, h ?gh) \<in> r" unfolding oexp_def Let_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
614 |
note * = this False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
615 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
616 |
proof (cases "f \<noteq> h") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
617 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
618 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
619 |
proof (cases "?fg = ?gh \<longrightarrow> f ?fg \<noteq> h ?gh") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
620 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
621 |
show ?thesis using max_fun_diff_max2[of f g h, OF True] * `f \<noteq> h` max_fun_diff_in |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
622 |
r.max2_iff[OF FINFUNCD FINFUNCD] r.max2_equals1[OF FINFUNCD FINFUNCD] max_fun_diff_le_eq |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
623 |
s.in_notinI[OF disjI1] unfolding oexp_def Let_def s.max2_def mem_Collect_eq by safe metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
624 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
625 |
case False with * show ?thesis unfolding oexp_def Let_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
626 |
using antisymD[OF r.ANTISYM, of "g ?gh" "h ?gh"] max_fun_diff_in[of g h] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
627 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
628 |
qed (auto simp: oexp_def *(3)) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
629 |
qed auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
630 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
631 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
632 |
lemma oexp_Preorder: "Preorder oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
633 |
unfolding preorder_on_def using oexp_Refl oexp_trans by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
634 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
635 |
lemma oexp_antisym: "antisym oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
636 |
proof (unfold antisym_def, safe, rule ccontr) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
637 |
fix f g assume "(f, g) \<in> oexp" "(g, f) \<in> oexp" "g \<noteq> f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
638 |
thus False using refl_onD[OF r.REFL FINFUNCD] max_fun_diff_in unfolding oexp_def Let_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
639 |
by (auto dest!: antisymD[OF r.ANTISYM] simp: s.max_fun_diff_commute) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
640 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
641 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
642 |
lemma oexp_Partial_order: "Partial_order oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
643 |
unfolding partial_order_on_def using oexp_Preorder oexp_antisym by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
644 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
645 |
lemma oexp_Total: "Total oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
646 |
unfolding total_on_def Field_oexp unfolding oexp_def using FINFUNCD max_fun_diff_in |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
647 |
by (auto simp: Let_def s.max_fun_diff_commute intro!: r.in_notinI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
648 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
649 |
lemma oexp_Linear_order: "Linear_order oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
650 |
unfolding linear_order_on_def using oexp_Partial_order oexp_Total by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
651 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
652 |
definition "const = (\<lambda>x. if x \<in> Field s then r.zero else undefined)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
653 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
654 |
lemma const_in[simp]: "x \<in> Field s \<Longrightarrow> const x = r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
655 |
unfolding const_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
656 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
657 |
lemma const_notin[simp]: "x \<notin> Field s \<Longrightarrow> const x = undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
658 |
unfolding const_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
659 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
660 |
lemma const_Int_Field[simp]: "Field s \<inter> - {x. const x = r.zero} = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
661 |
by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
662 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
663 |
lemma const_FINFUNC[simp]: "Field r \<noteq> {} \<Longrightarrow> const \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
664 |
unfolding FinFunc_def Func_def fin_support_def support_def const_def Int_iff mem_Collect_eq |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
665 |
using r.zero_in_Field by (metis (lifting) Collect_empty_eq finite.emptyI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
666 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
667 |
lemma const_least: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
668 |
assumes "Field r \<noteq> {}" "f \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
669 |
shows "(const, f) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
670 |
proof (cases "f = const") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
671 |
case True thus ?thesis using refl_onD[OF oexp_Refl] assms(2) unfolding Field_oexp by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
672 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
673 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
674 |
with assms show ?thesis using max_fun_diff_in[of f const] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
675 |
unfolding oexp_def Let_def by (auto intro: r.zero_smallest FinFuncD simp: s.max_fun_diff_commute) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
676 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
677 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
678 |
lemma support_not_const: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
679 |
assumes "F \<subseteq> FINFUNC" and "const \<notin> F" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
680 |
shows "\<forall>f \<in> F. finite (SUPP f) \<and> SUPP f \<noteq> {} \<and> SUPP f \<subseteq> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
681 |
proof (intro ballI conjI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
682 |
fix f assume "f \<in> F" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
683 |
thus "finite (SUPP f)" "SUPP f \<subseteq> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
684 |
using assms(1) unfolding FinFunc_def fin_support_def support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
685 |
show "SUPP f \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
686 |
proof (rule ccontr, unfold not_not) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
687 |
assume "SUPP f = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
688 |
moreover from `f \<in> F` assms(1) have "f \<in> FINFUNC" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
689 |
ultimately have "f = const" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
690 |
by (auto simp: fun_eq_iff support_def FinFunc_def Func_def const_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
691 |
with assms(2) `f \<in> F` show False by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
692 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
693 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
694 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
695 |
lemma maxim_isMaxim_support: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
696 |
assumes f: "F \<subseteq> FINFUNC" and "const \<notin> F" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
697 |
shows "\<forall>f \<in> F. s.isMaxim (SUPP f) (s.maxim (SUPP f))" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
698 |
using support_not_const[OF assms] by (auto intro!: s.maxim_isMaxim) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
699 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
700 |
lemma oexp_empty2: "Field s = {} \<Longrightarrow> oexp = {(\<lambda>x. undefined, \<lambda>x. undefined)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
701 |
unfolding oexp_def FinFunc_def fin_support_def support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
702 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
703 |
lemma oexp_empty: "\<lbrakk>Field r = {}; Field s \<noteq> {}\<rbrakk> \<Longrightarrow> oexp = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
704 |
unfolding oexp_def FinFunc_def Let_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
705 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
706 |
lemma fun_upd_FINFUNC: "\<lbrakk>f \<in> FINFUNC; x \<in> Field s; y \<in> Field r\<rbrakk> \<Longrightarrow> f(x := y) \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
707 |
unfolding FinFunc_def Func_def fin_support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
708 |
by (auto intro: finite_subset[OF support_upd_subset]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
709 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
710 |
lemma fun_upd_same_oexp: |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
711 |
assumes "(f, g) \<in> oexp" "f x = g x" "x \<in> Field s" "y \<in> Field r" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
712 |
shows "(f(x := y), g(x := y)) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
713 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
714 |
from assms(1) fun_upd_FINFUNC[OF _ assms(3,4)] have fg: "f(x := y) \<in> FINFUNC" "g(x := y) \<in> FINFUNC" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
715 |
unfolding oexp_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
716 |
moreover from assms(2) have "s.max_fun_diff (f(x := y)) (g(x := y)) = s.max_fun_diff f g" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
717 |
unfolding s.max_fun_diff_def by auto metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
718 |
ultimately show ?thesis using assms refl_onD[OF r.REFL] unfolding oexp_def Let_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
719 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
720 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
721 |
lemma fun_upd_smaller_oexp: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
722 |
assumes "f \<in> FINFUNC" "x \<in> Field s" "y \<in> Field r" "(y, f x) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
723 |
shows "(f(x := y), f) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
724 |
using assms fun_upd_FINFUNC[OF assms(1-3)] s.maxim_singleton[of "x"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
725 |
unfolding oexp_def FinFunc_def Let_def fin_support_def s.max_fun_diff_def by (auto simp: fun_eq_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
726 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
727 |
lemma oexp_wf_Id: "wf (oexp - Id)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
728 |
proof (cases "Field r = {} \<or> Field s = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
729 |
case True thus ?thesis using oexp_empty oexp_empty2 by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
730 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
731 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
732 |
hence Fields: "Field s \<noteq> {}" "Field r \<noteq> {}" by simp_all |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
733 |
hence [simp]: "r.zero \<in> Field r" by (intro r.zero_in_Field) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
734 |
have const[simp]: "\<And>F. \<lbrakk>const \<in> F; F \<subseteq> FINFUNC\<rbrakk> \<Longrightarrow> \<exists>f0\<in>F. \<forall>f\<in>F. (f0, f) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
735 |
using const_least[OF Fields(2)] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
736 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
737 |
unfolding Linear_order_wf_diff_Id[OF oexp_Linear_order] Field_oexp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
738 |
proof (intro allI impI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
739 |
fix A assume A: "A \<subseteq> FINFUNC" "A \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
740 |
{ fix y F |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
741 |
have "F \<subseteq> FINFUNC \<and> (\<exists>f \<in> F. y = s.maxim (SUPP f)) \<longrightarrow> |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
742 |
(\<exists>f0 \<in> F. \<forall>f \<in> F. (f0, f) \<in> oexp)" (is "?P F y") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
743 |
proof (induct y arbitrary: F rule: s.well_order_induct) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
744 |
case (1 y) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
745 |
show ?case |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
746 |
proof (intro impI, elim conjE bexE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
747 |
fix f assume F: "F \<subseteq> FINFUNC" "f \<in> F" "y = s.maxim (SUPP f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
748 |
thus "\<exists>f0\<in>F. \<forall>f\<in>F. (f0, f) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
749 |
proof (cases "const \<in> F") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
750 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
751 |
with F have maxF: "\<forall>f \<in> F. s.isMaxim (SUPP f) (s.maxim (SUPP f))" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
752 |
and SUPPF: "\<forall>f \<in> F. finite (SUPP f) \<and> SUPP f \<noteq> {} \<and> SUPP f \<subseteq> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
753 |
using maxim_isMaxim_support support_not_const by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
754 |
def z \<equiv> "s.minim {s.maxim (SUPP f) | f. f \<in> F}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
755 |
from F SUPPF maxF have zmin: "s.isMinim {s.maxim (SUPP f) | f. f \<in> F} z" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
756 |
unfolding z_def by (intro s.minim_isMinim) (auto simp: s.isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
757 |
with F have zy: "(z, y) \<in> s" unfolding s.isMinim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
758 |
hence zField: "z \<in> Field s" unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
759 |
def x0 \<equiv> "r.minim {f z | f. f \<in> F \<and> z = s.maxim (SUPP f)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
760 |
from F(1,2) maxF(1) SUPPF zmin |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
761 |
have x0min: "r.isMinim {f z | f. f \<in> F \<and> z = s.maxim (SUPP f)} x0" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
762 |
unfolding x0_def s.isMaxim_def s.isMinim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
763 |
by (blast intro!: r.minim_isMinim FinFuncD[of _ r s]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
764 |
with maxF(1) SUPPF F(1) have x0Field: "x0 \<in> Field r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
765 |
unfolding r.isMinim_def s.isMaxim_def by (auto intro!: FINFUNCD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
766 |
from x0min maxF(1) SUPPF F(1) have x0notzero: "x0 \<noteq> r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
767 |
unfolding r.isMinim_def s.isMaxim_def FinFunc_def Func_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
768 |
by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
769 |
def G \<equiv> "{f(z := r.zero) | f. f \<in> F \<and> z = s.maxim (SUPP f) \<and> f z = x0}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
770 |
from zmin x0min have "G \<noteq> {}" unfolding G_def z_def s.isMinim_def r.isMinim_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
771 |
have GF: "G \<subseteq> (\<lambda>f. f(z := r.zero)) ` F" unfolding G_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
772 |
have "G \<subseteq> fin_support r.zero (Field s)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
773 |
unfolding FinFunc_def fin_support_def proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
774 |
fix g assume "g \<in> G" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
775 |
with GF obtain f where "f \<in> F" "g = f(z := r.zero)" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
776 |
moreover with SUPPF have "finite (SUPP f)" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
777 |
ultimately show "finite (SUPP g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
778 |
by (elim finite_subset[rotated]) (auto simp: support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
779 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
780 |
moreover from F GF zField have "G \<subseteq> Func (Field s) (Field r)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
781 |
using Func_upd[of _ "Field s" "Field r" z r.zero] unfolding FinFunc_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
782 |
ultimately have G: "G \<subseteq> FINFUNC" unfolding FinFunc_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
783 |
hence "\<exists>g0\<in>G. \<forall>g\<in>G. (g0, g) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
784 |
proof (cases "const \<in> G") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
785 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
786 |
with G have maxG: "\<forall>g \<in> G. s.isMaxim (SUPP g) (s.maxim (SUPP g))" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
787 |
and SUPPG: "\<forall>g \<in> G. finite (SUPP g) \<and> SUPP g \<noteq> {} \<and> SUPP g \<subseteq> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
788 |
using maxim_isMaxim_support support_not_const by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
789 |
def y' \<equiv> "s.minim {s.maxim (SUPP f) | f. f \<in> G}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
790 |
from G SUPPG maxG `G \<noteq> {}` have y'min: "s.isMinim {s.maxim (SUPP f) | f. f \<in> G} y'" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
791 |
unfolding y'_def by (intro s.minim_isMinim) (auto simp: s.isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
792 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
793 |
have "\<forall>g \<in> G. z \<notin> SUPP g" unfolding support_def G_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
794 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
795 |
{ fix g assume g: "g \<in> G" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
796 |
then obtain f where "f \<in> F" "g = f(z := r.zero)" and z: "z = s.maxim (SUPP f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
797 |
unfolding G_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
798 |
with SUPPF bspec[OF SUPPG g] have "(s.maxim (SUPP g), z) \<in> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
799 |
unfolding z by (intro s.maxim_mono) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
800 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
801 |
moreover from y'min have "\<And>g. g \<in> G \<Longrightarrow> (y', s.maxim (SUPP g)) \<in> s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
802 |
unfolding s.isMinim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
803 |
ultimately have "y' \<noteq> z" "(y', z) \<in> s" using maxG |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
804 |
unfolding s.isMinim_def s.isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
805 |
with zy have "y' \<noteq> y" "(y', y) \<in> s" using antisymD[OF s.ANTISYM] transD[OF s.TRANS] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
806 |
by blast+ |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
807 |
moreover from `G \<noteq> {}` have "\<exists>g \<in> G. y' = wo_rel.maxim s (SUPP g)" using y'min |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
808 |
by (auto simp: G_def s.isMinim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
809 |
ultimately show ?thesis using mp[OF spec[OF mp[OF spec[OF 1]]], of y' G] G by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
810 |
qed simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
811 |
then obtain g0 where g0: "g0 \<in> G" "\<forall>g \<in> G. (g0, g) \<in> oexp" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
812 |
hence g0z: "g0 z = r.zero" unfolding G_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
813 |
def f0 \<equiv> "g0(z := x0)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
814 |
with x0notzero zField have SUPP: "SUPP f0 = SUPP g0 \<union> {z}" unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
815 |
from g0z have f0z: "f0(z := r.zero) = g0" unfolding f0_def fun_upd_upd by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
816 |
have f0: "f0 \<in> F" using x0min g0(1) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
817 |
Func_elim[OF set_mp[OF subset_trans[OF F(1)[unfolded FinFunc_def] Int_lower1]] zField] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
818 |
unfolding f0_def r.isMinim_def G_def by (force simp: fun_upd_idem) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
819 |
from g0(1) maxF(1) have maxf0: "s.maxim (SUPP f0) = z" unfolding SUPP G_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
820 |
by (intro s.maxim_equality) (auto simp: s.isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
821 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
822 |
proof (intro bexI[OF _ f0] ballI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
823 |
fix f assume f: "f \<in> F" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
824 |
show "(f0, f) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
825 |
proof (cases "f0 = f") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
826 |
case True thus ?thesis by (metis F(1) Field_oexp f0 in_mono oexp_Refl refl_onD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
827 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
828 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
829 |
thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
830 |
proof (cases "s.maxim (SUPP f) = z \<and> f z = x0") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
831 |
case True |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
832 |
with f have "f(z := r.zero) \<in> G" unfolding G_def by blast |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
833 |
with g0(2) f0z have "(f0(z := r.zero), f(z := r.zero)) \<in> oexp" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
834 |
hence "(f0(z := r.zero, z := x0), f(z := r.zero, z := x0)) \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
835 |
by (elim fun_upd_same_oexp[OF _ _ zField x0Field]) simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
836 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
837 |
with f F(1) x0min True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
838 |
have "(f(z := x0), f) \<in> oexp" unfolding G_def r.isMinim_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
839 |
by (intro fun_upd_smaller_oexp[OF _ zField x0Field]) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
840 |
ultimately show ?thesis using transD[OF oexp_trans, of f0 "f(z := x0)" f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
841 |
unfolding f0_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
842 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
843 |
case False note notG = this |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
844 |
thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
845 |
proof (cases "s.maxim (SUPP f) = z") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
846 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
847 |
with notG have "f0 z \<noteq> f z" unfolding f0_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
848 |
hence "f0 z \<noteq> f z" by metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
849 |
with True maxf0 f0 f SUPPF have "s.max_fun_diff f0 f = z" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
850 |
using s.maxim_Un[of "SUPP f0" "SUPP f", unfolded s.max2_def] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
851 |
unfolding max_fun_diff_alt by (intro trans[OF s.maxim_Int]) auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
852 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
853 |
from x0min True f have "(x0, f z) \<in> r" unfolding r.isMinim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
854 |
ultimately show ?thesis using f f0 F(1) unfolding oexp_def f0_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
855 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
856 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
857 |
with notG have *: "(z, s.maxim (SUPP f)) \<in> s" "z \<noteq> s.maxim (SUPP f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
858 |
using zmin f unfolding s.isMinim_def G_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
859 |
have f0f: "f0 (s.maxim (SUPP f)) = r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
860 |
proof (rule ccontr) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
861 |
assume "f0 (s.maxim (SUPP f)) \<noteq> r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
862 |
with f SUPPF maxF(1) have "s.maxim (SUPP f) \<in> SUPP f0" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
863 |
unfolding support_def[of _ _ f0] s.isMaxim_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
864 |
with SUPPF f0 have "(s.maxim (SUPP f), z) \<in> s" unfolding maxf0[symmetric] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
865 |
by (auto intro: s.maxim_greatest) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
866 |
with * antisymD[OF s.ANTISYM] show False by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
867 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
868 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
869 |
have "f (s.maxim (SUPP f)) \<noteq> r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
870 |
using bspec[OF maxF(1) f, unfolded s.isMaxim_def] by (auto simp: support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
871 |
with f0f * f f0 maxf0 SUPPF |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
872 |
have "s.max_fun_diff f0 f = s.maxim (SUPP f0 \<union> SUPP f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
873 |
unfolding max_fun_diff_alt using s.maxim_Un[of "SUPP f0" "SUPP f"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
874 |
by (intro s.maxim_Int) (auto simp: s.max2_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
875 |
moreover have "s.maxim (SUPP f0 \<union> SUPP f) = s.maxim (SUPP f)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
876 |
using s.maxim_Un[of "SUPP f0" "SUPP f"] * maxf0 SUPPF f0 f |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
877 |
by (auto simp: s.max2_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
878 |
ultimately show ?thesis using f f0 F(1) maxF(1) SUPPF unfolding oexp_def Let_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
879 |
by (fastforce simp: s.isMaxim_def intro!: r.zero_smallest FINFUNCD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
880 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
881 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
882 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
883 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
884 |
qed simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
885 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
886 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
887 |
} note * = mp[OF this] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
888 |
from A(2) obtain f where f: "f \<in> A" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
889 |
with A(1) show "\<exists>a\<in>A. \<forall>a'\<in>A. (a, a') \<in> oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
890 |
proof (cases "f = const") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
891 |
case False with f A(1) show ?thesis using maxim_isMaxim_support[of "{f}"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
892 |
by (intro *[of _ "s.maxim (SUPP f)"]) (auto simp: s.isMaxim_def support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
893 |
qed simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
894 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
895 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
896 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
897 |
lemma oexp_Well_order: "Well_order oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
898 |
unfolding well_order_on_def using oexp_Linear_order oexp_wf_Id by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
899 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
900 |
interpretation o: wo_rel oexp by unfold_locales (rule oexp_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
901 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
902 |
lemma zero_oexp: "Field r \<noteq> {} \<Longrightarrow> o.zero = const" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
903 |
by (rule sym[OF o.leq_zero_imp[OF const_least]]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
904 |
(auto intro!: o.zero_in_Field[unfolded Field_oexp] dest!: const_FINFUNC) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
905 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
906 |
end |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
907 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
908 |
notation wo_rel2.oexp (infixl "^o" 90) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
909 |
lemmas oexp_def = wo_rel2.oexp_def[unfolded wo_rel2_def, OF conjI] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
910 |
lemmas oexp_Well_order = wo_rel2.oexp_Well_order[unfolded wo_rel2_def, OF conjI] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
911 |
lemmas Field_oexp = wo_rel2.Field_oexp[unfolded wo_rel2_def, OF conjI] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
912 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
913 |
definition "ozero = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
914 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
915 |
lemma ozero_Well_order[simp]: "Well_order ozero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
916 |
unfolding ozero_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
917 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
918 |
lemma ozero_ordIso[simp]: "ozero =o ozero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
919 |
unfolding ozero_def ordIso_def iso_def[abs_def] embed_def bij_betw_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
920 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
921 |
lemma Field_ozero[simp]: "Field ozero = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
922 |
unfolding ozero_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
923 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
924 |
lemma iso_ozero_empty[simp]: "r =o ozero = (r = {})" |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
925 |
unfolding ozero_def ordIso_def iso_def[abs_def] embed_def bij_betw_def |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
926 |
by (auto dest: well_order_on_domain) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
927 |
|
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
928 |
lemma ozero_ordLeq: |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
929 |
assumes "Well_order r" shows "ozero \<le>o r" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
930 |
using assms unfolding ozero_def ordLeq_def embed_def[abs_def] under_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
931 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
932 |
definition "oone = {((),())}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
933 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
934 |
lemma oone_Well_order[simp]: "Well_order oone" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
935 |
unfolding oone_def unfolding well_order_on_def linear_order_on_def partial_order_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
936 |
preorder_on_def total_on_def refl_on_def trans_def antisym_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
937 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
938 |
lemma Field_oone[simp]: "Field oone = {()}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
939 |
unfolding oone_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
940 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
941 |
lemma oone_ordIso: "oone =o {(x,x)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
942 |
unfolding ordIso_def oone_def well_order_on_def linear_order_on_def partial_order_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
943 |
preorder_on_def total_on_def refl_on_def trans_def antisym_def |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
944 |
by (auto simp: iso_def embed_def bij_betw_def under_def inj_on_def intro!: exI[of _ "\<lambda>_. x"]) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
945 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
946 |
lemma osum_ordLeqR: "Well_order r \<Longrightarrow> Well_order s \<Longrightarrow> s \<le>o r +o s" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
947 |
unfolding ordLeq_def2 underS_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
948 |
by (auto intro!: exI[of _ Inr] osum_Well_order) (auto simp add: osum_def Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
949 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
950 |
lemma osum_congL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
951 |
assumes "r =o s" and t: "Well_order t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
952 |
shows "r +o t =o s +o t" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
953 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
954 |
from assms(1) obtain f where r: "Well_order r" and s: "Well_order s" and f: "iso r s f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
955 |
unfolding ordIso_def by blast |
55931 | 956 |
let ?f = "map_sum f id" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
957 |
from f have "inj_on ?f (Field ?L)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
958 |
unfolding Field_osum iso_def bij_betw_def inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
959 |
with f have "bij_betw ?f (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
960 |
unfolding Field_osum iso_def bij_betw_def image_image image_Un by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
961 |
moreover from f have "compat ?L ?R ?f" |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
962 |
unfolding osum_def iso_iff3[OF r s] compat_def bij_betw_def |
55932 | 963 |
by (auto simp: map_prod_imageI) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
964 |
ultimately have "iso ?L ?R ?f" by (subst iso_iff3) (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
965 |
thus ?thesis unfolding ordIso_def by (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
966 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
967 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
968 |
lemma osum_congR: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
969 |
assumes "r =o s" and t: "Well_order t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
970 |
shows "t +o r =o t +o s" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
971 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
972 |
from assms(1) obtain f where r: "Well_order r" and s: "Well_order s" and f: "iso r s f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
973 |
unfolding ordIso_def by blast |
55931 | 974 |
let ?f = "map_sum id f" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
975 |
from f have "inj_on ?f (Field ?L)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
976 |
unfolding Field_osum iso_def bij_betw_def inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
977 |
with f have "bij_betw ?f (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
978 |
unfolding Field_osum iso_def bij_betw_def image_image image_Un by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
979 |
moreover from f have "compat ?L ?R ?f" |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
980 |
unfolding osum_def iso_iff3[OF r s] compat_def bij_betw_def |
55932 | 981 |
by (auto simp: map_prod_imageI) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
982 |
ultimately have "iso ?L ?R ?f" by (subst iso_iff3) (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
983 |
thus ?thesis unfolding ordIso_def by (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
984 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
985 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
986 |
lemma osum_cong: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
987 |
assumes "t =o u" and "r =o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
988 |
shows "t +o r =o u +o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
989 |
using ordIso_transitive[OF osum_congL[OF assms(1)] osum_congR[OF assms(2)]] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
990 |
assms[unfolded ordIso_def] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
991 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
992 |
lemma Well_order_empty[simp]: "Well_order {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
993 |
unfolding Field_empty by (rule well_order_on_empty) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
994 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
995 |
lemma well_order_on_singleton[simp]: "well_order_on {x} {(x, x)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
996 |
unfolding well_order_on_def linear_order_on_def partial_order_on_def preorder_on_def total_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
997 |
Field_def refl_on_def trans_def antisym_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
998 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
999 |
lemma oexp_empty[simp]: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1000 |
assumes "Well_order r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1001 |
shows "r ^o {} = {(\<lambda>x. undefined, \<lambda>x. undefined)}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1002 |
unfolding oexp_def[OF assms Well_order_empty] FinFunc_def fin_support_def support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1003 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1004 |
lemma oexp_empty2[simp]: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1005 |
assumes "Well_order r" "r \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1006 |
shows "{} ^o r = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1007 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1008 |
from assms(2) have "Field r \<noteq> {}" unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1009 |
thus ?thesis unfolding oexp_def[OF Well_order_empty assms(1)] FinFunc_def fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1010 |
by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1011 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1012 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1013 |
lemma oprod_zero[simp]: "{} *o r = {}" "r *o {} = {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1014 |
unfolding oprod_def by simp_all |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1015 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1016 |
lemma oprod_congL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1017 |
assumes "r =o s" and t: "Well_order t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1018 |
shows "r *o t =o s *o t" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1019 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1020 |
from assms(1) obtain f where r: "Well_order r" and s: "Well_order s" and f: "iso r s f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1021 |
unfolding ordIso_def by blast |
55932 | 1022 |
let ?f = "map_prod f id" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1023 |
from f have "inj_on ?f (Field ?L)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1024 |
unfolding Field_oprod iso_def bij_betw_def inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1025 |
with f have "bij_betw ?f (Field ?L) (Field ?R)" |
55932 | 1026 |
unfolding Field_oprod iso_def bij_betw_def by (auto intro!: map_prod_surj_on) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1027 |
moreover from f have "compat ?L ?R ?f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1028 |
unfolding iso_iff3[OF r s] compat_def oprod_def bij_betw_def |
55932 | 1029 |
by (auto simp: map_prod_imageI) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1030 |
ultimately have "iso ?L ?R ?f" by (subst iso_iff3) (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1031 |
thus ?thesis unfolding ordIso_def by (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1032 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1033 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1034 |
lemma oprod_congR: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1035 |
assumes "r =o s" and t: "Well_order t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1036 |
shows "t *o r =o t *o s" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1037 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1038 |
from assms(1) obtain f where r: "Well_order r" and s: "Well_order s" and f: "iso r s f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1039 |
unfolding ordIso_def by blast |
55932 | 1040 |
let ?f = "map_prod id f" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1041 |
from f have "inj_on ?f (Field ?L)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1042 |
unfolding Field_oprod iso_def bij_betw_def inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1043 |
with f have "bij_betw ?f (Field ?L) (Field ?R)" |
55932 | 1044 |
unfolding Field_oprod iso_def bij_betw_def by (auto intro!: map_prod_surj_on) |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1045 |
moreover from f well_order_on_domain[OF r] have "compat ?L ?R ?f" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1046 |
unfolding iso_iff3[OF r s] compat_def oprod_def bij_betw_def |
55932 | 1047 |
by (auto simp: map_prod_imageI dest: inj_onD) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1048 |
ultimately have "iso ?L ?R ?f" by (subst iso_iff3) (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1049 |
thus ?thesis unfolding ordIso_def by (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1050 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1051 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1052 |
lemma oprod_cong: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1053 |
assumes "t =o u" and "r =o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1054 |
shows "t *o r =o u *o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1055 |
using ordIso_transitive[OF oprod_congL[OF assms(1)] oprod_congR[OF assms(2)]] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1056 |
assms[unfolded ordIso_def] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1057 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1058 |
lemma Field_singleton[simp]: "Field {(z,z)} = {z}" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1059 |
by (metis well_order_on_Field well_order_on_singleton) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1060 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1061 |
lemma zero_singleton[simp]: "zero {(z,z)} = z" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1062 |
using wo_rel.zero_in_Field[unfolded wo_rel_def, of "{(z, z)}"] well_order_on_singleton[of z] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1063 |
by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1064 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1065 |
lemma FinFunc_singleton: "FinFunc {(z,z)} s = {\<lambda>x. if x \<in> Field s then z else undefined}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1066 |
unfolding FinFunc_def Func_def fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1067 |
by (auto simp: fun_eq_iff split: split_if_asm intro!: finite_subset[of _ "{}"]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1068 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1069 |
lemma oone_ordIso_oexp: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1070 |
assumes "r =o oone" and s: "Well_order s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1071 |
shows "r ^o s =o oone" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1072 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1073 |
from assms obtain f where *: "\<forall>x\<in>Field r. \<forall>y\<in>Field r. x = y" and "f ` Field r = {()}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1074 |
and r: "Well_order r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1075 |
unfolding ordIso_def oone_def by (auto simp: iso_def bij_betw_def inj_on_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1076 |
then obtain x where "x \<in> Field r" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1077 |
with * have Fr: "Field r = {x}" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1078 |
interpret r: wo_rel r by unfold_locales (rule r) |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1079 |
from Fr well_order_on_domain[OF r] refl_onD[OF r.REFL, of x] have r_def: "r = {(x, x)}" by fast |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1080 |
interpret wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1081 |
have "bij_betw (\<lambda>x. ()) (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1082 |
unfolding bij_betw_def Field_oexp by (auto simp: r_def FinFunc_singleton) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1083 |
moreover have "compat ?L ?R (\<lambda>x. ())" unfolding compat_def oone_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1084 |
ultimately have "iso ?L ?R (\<lambda>x. ())" using s oone_Well_order |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1085 |
by (subst iso_iff3) (auto intro: oexp_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1086 |
thus ?thesis using s oone_Well_order unfolding ordIso_def by (auto intro: oexp_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1087 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1088 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1089 |
(*Lemma 1.4.3 from Holz et al.*) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1090 |
context |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1091 |
fixes r s t |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1092 |
assumes r: "Well_order r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1093 |
assumes s: "Well_order s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1094 |
assumes t: "Well_order t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1095 |
begin |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1096 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1097 |
lemma osum_ozeroL: "ozero +o r =o r" |
55932 | 1098 |
using r unfolding osum_def ozero_def by (auto intro: map_prod_ordIso) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1099 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1100 |
lemma osum_ozeroR: "r +o ozero =o r" |
55932 | 1101 |
using r unfolding osum_def ozero_def by (auto intro: map_prod_ordIso) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1102 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1103 |
lemma osum_assoc: "(r +o s) +o t =o r +o s +o t" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1104 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1105 |
let ?f = |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1106 |
"\<lambda>rst. case rst of Inl (Inl r) \<Rightarrow> Inl r | Inl (Inr s) \<Rightarrow> Inr (Inl s) | Inr t \<Rightarrow> Inr (Inr t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1107 |
have "bij_betw ?f (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1108 |
unfolding Field_osum bij_betw_def inj_on_def by (auto simp: image_Un image_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1109 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1110 |
have "compat ?L ?R ?f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1111 |
proof (unfold compat_def, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1112 |
fix a b |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1113 |
assume "(a, b) \<in> ?L" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1114 |
thus "(?f a, ?f b) \<in> ?R" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1115 |
unfolding osum_def[of "r +o s" t] osum_def[of r "s +o t"] Field_osum |
55932 | 1116 |
unfolding osum_def Field_osum image_iff image_Un map_prod_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1117 |
by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1118 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1119 |
ultimately have "iso ?L ?R ?f" using r s t by (subst iso_iff3) (auto intro: osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1120 |
thus ?thesis using r s t unfolding ordIso_def by (auto intro: osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1121 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1122 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1123 |
lemma osum_monoR: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1124 |
assumes "s <o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1125 |
shows "r +o s <o r +o t" (is "?L <o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1126 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1127 |
from assms obtain f where s: "Well_order s" and t:" Well_order t" and "embedS s t f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1128 |
unfolding ordLess_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1129 |
hence *: "inj_on f (Field s)" "compat s t f" "ofilter t (f ` Field s)" "f ` Field s \<subset> Field t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1130 |
using embed_iff_compat_inj_on_ofilter[OF s t, of f] embedS_iff[OF s, of t f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1131 |
unfolding embedS_def by auto |
55931 | 1132 |
let ?f = "map_sum id f" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1133 |
from *(1) have "inj_on ?f (Field ?L)" unfolding Field_osum inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1134 |
moreover |
55932 | 1135 |
from *(2,4) have "compat ?L ?R ?f" unfolding compat_def osum_def map_prod_def by fastforce |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1136 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1137 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1138 |
interpret rt!: wo_rel ?R by unfold_locales (rule osum_Well_order[OF r t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1139 |
from *(3) have "ofilter ?R (?f ` Field ?L)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1140 |
unfolding t.ofilter_def rt.ofilter_def Field_osum image_Un image_image under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1141 |
by (auto simp: osum_def intro!: imageI) (auto simp: Field_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1142 |
ultimately have "embed ?L ?R ?f" using embed_iff_compat_inj_on_ofilter[of ?L ?R ?f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1143 |
by (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1144 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1145 |
from *(4) have "?f ` Field ?L \<subset> Field ?R" unfolding Field_osum image_Un image_image by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1146 |
ultimately have "embedS ?L ?R ?f" using embedS_iff[OF osum_Well_order[OF r s], of ?R ?f] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1147 |
thus ?thesis unfolding ordLess_def by (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1148 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1149 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1150 |
lemma osum_monoL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1151 |
assumes "r \<le>o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1152 |
shows "r +o t \<le>o s +o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1153 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1154 |
from assms obtain f where f: "\<forall>a\<in>Field r. f a \<in> Field s \<and> f ` underS r a \<subseteq> underS s (f a)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1155 |
unfolding ordLeq_def2 by blast |
55931 | 1156 |
let ?f = "map_sum f id" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1157 |
from f have "\<forall>a\<in>Field (r +o t). |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1158 |
?f a \<in> Field (s +o t) \<and> ?f ` underS (r +o t) a \<subseteq> underS (s +o t) (?f a)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1159 |
unfolding Field_osum underS_def by (fastforce simp: osum_def) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1160 |
thus ?thesis unfolding ordLeq_def2 by (auto intro: osum_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1161 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1162 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1163 |
lemma oprod_ozeroL: "ozero *o r =o ozero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1164 |
using ozero_ordIso unfolding ozero_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1165 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1166 |
lemma oprod_ozeroR: "r *o ozero =o ozero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1167 |
using ozero_ordIso unfolding ozero_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1168 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1169 |
lemma oprod_ooneR: "r *o oone =o r" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1170 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1171 |
have "bij_betw fst (Field ?L) (Field ?R)" unfolding Field_oprod bij_betw_def inj_on_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1172 |
moreover have "compat ?L ?R fst" unfolding compat_def oprod_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1173 |
ultimately have "iso ?L ?R fst" using r oone_Well_order |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1174 |
by (subst iso_iff3) (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1175 |
thus ?thesis using r oone_Well_order unfolding ordIso_def by (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1176 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1177 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1178 |
lemma oprod_ooneL: "oone *o r =o r" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1179 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1180 |
have "bij_betw snd (Field ?L) (Field ?R)" unfolding Field_oprod bij_betw_def inj_on_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1181 |
moreover have "Refl r" by (rule wo_rel.REFL[unfolded wo_rel_def, OF r]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1182 |
hence "compat ?L ?R snd" unfolding compat_def oprod_def refl_on_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1183 |
ultimately have "iso ?L ?R snd" using r oone_Well_order |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1184 |
by (subst iso_iff3) (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1185 |
thus ?thesis using r oone_Well_order unfolding ordIso_def by (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1186 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1187 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1188 |
lemma oprod_monoR: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1189 |
assumes "ozero <o r" "s <o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1190 |
shows "r *o s <o r *o t" (is "?L <o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1191 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1192 |
from assms obtain f where s: "Well_order s" and t:" Well_order t" and "embedS s t f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1193 |
unfolding ordLess_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1194 |
hence *: "inj_on f (Field s)" "compat s t f" "ofilter t (f ` Field s)" "f ` Field s \<subset> Field t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1195 |
using embed_iff_compat_inj_on_ofilter[OF s t, of f] embedS_iff[OF s, of t f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1196 |
unfolding embedS_def by auto |
55932 | 1197 |
let ?f = "map_prod id f" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1198 |
from *(1) have "inj_on ?f (Field ?L)" unfolding Field_oprod inj_on_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1199 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1200 |
from *(2,4) the_inv_into_f_f[OF *(1)] have "compat ?L ?R ?f" unfolding compat_def oprod_def |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1201 |
by auto (metis well_order_on_domain t, metis well_order_on_domain s) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1202 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1203 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1204 |
interpret rt!: wo_rel ?R by unfold_locales (rule oprod_Well_order[OF r t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1205 |
from *(3) have "ofilter ?R (?f ` Field ?L)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1206 |
unfolding t.ofilter_def rt.ofilter_def Field_oprod under_def |
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1207 |
by (auto simp: oprod_def image_iff) (fast | metis r well_order_on_domain)+ |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1208 |
ultimately have "embed ?L ?R ?f" using embed_iff_compat_inj_on_ofilter[of ?L ?R ?f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1209 |
by (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1210 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1211 |
from not_ordLess_ordIso[OF assms(1)] have "r \<noteq> {}" by (metis ozero_def ozero_ordIso) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1212 |
hence "Field r \<noteq> {}" unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1213 |
with *(4) have "?f ` Field ?L \<subset> Field ?R" unfolding Field_oprod |
55932 | 1214 |
by auto (metis SigmaD2 SigmaI map_prod_surj_on) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1215 |
ultimately have "embedS ?L ?R ?f" using embedS_iff[OF oprod_Well_order[OF r s], of ?R ?f] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1216 |
thus ?thesis unfolding ordLess_def by (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1217 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1218 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1219 |
lemma oprod_monoL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1220 |
assumes "r \<le>o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1221 |
shows "r *o t \<le>o s *o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1222 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1223 |
from assms obtain f where f: "\<forall>a\<in>Field r. f a \<in> Field s \<and> f ` underS r a \<subseteq> underS s (f a)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1224 |
unfolding ordLeq_def2 by blast |
55932 | 1225 |
let ?f = "map_prod f id" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1226 |
from f have "\<forall>a\<in>Field (r *o t). |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1227 |
?f a \<in> Field (s *o t) \<and> ?f ` underS (r *o t) a \<subseteq> underS (s *o t) (?f a)" |
55932 | 1228 |
unfolding Field_oprod underS_def unfolding map_prod_def oprod_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1229 |
thus ?thesis unfolding ordLeq_def2 by (auto intro: oprod_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1230 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1231 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1232 |
lemma oprod_assoc: "(r *o s) *o t =o r *o s *o t" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1233 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1234 |
let ?f = "\<lambda>((a,b),c). (a,b,c)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1235 |
have "bij_betw ?f (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1236 |
unfolding Field_oprod bij_betw_def inj_on_def by (auto simp: image_Un image_iff) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1237 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1238 |
have "compat ?L ?R ?f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1239 |
proof (unfold compat_def, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1240 |
fix a1 a2 a3 b1 b2 b3 |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1241 |
assume "(((a1, a2), a3), ((b1, b2), b3)) \<in> ?L" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1242 |
thus "((a1, a2, a3), (b1, b2, b3)) \<in> ?R" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1243 |
unfolding oprod_def[of "r *o s" t] oprod_def[of r "s *o t"] Field_oprod |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1244 |
unfolding oprod_def Field_oprod image_iff image_Un by fast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1245 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1246 |
ultimately have "iso ?L ?R ?f" using r s t by (subst iso_iff3) (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1247 |
thus ?thesis using r s t unfolding ordIso_def by (auto intro: oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1248 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1249 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1250 |
lemma oprod_osum: "r *o (s +o t) =o r *o s +o r *o t" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1251 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1252 |
let ?f = "\<lambda>(a,bc). case bc of Inl b \<Rightarrow> Inl (a, b) | Inr c \<Rightarrow> Inr (a, c)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1253 |
have "bij_betw ?f (Field ?L) (Field ?R)" unfolding Field_oprod Field_osum bij_betw_def inj_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1254 |
by (fastforce simp: image_Un image_iff split: sum.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1255 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1256 |
have "compat ?L ?R ?f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1257 |
proof (unfold compat_def, intro allI impI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1258 |
fix a b |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1259 |
assume "(a, b) \<in> ?L" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1260 |
thus "(?f a, ?f b) \<in> ?R" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1261 |
unfolding oprod_def[of r "s +o t"] osum_def[of "r *o s" "r *o t"] Field_oprod Field_osum |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1262 |
unfolding oprod_def osum_def Field_oprod Field_osum image_iff image_Un by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1263 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1264 |
ultimately have "iso ?L ?R ?f" using r s t |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1265 |
by (subst iso_iff3) (auto intro: oprod_Well_order osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1266 |
thus ?thesis using r s t unfolding ordIso_def by (auto intro: oprod_Well_order osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1267 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1268 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1269 |
lemma ozero_oexp: "\<not> (s =o ozero) \<Longrightarrow> ozero ^o s =o ozero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1270 |
unfolding oexp_def[OF ozero_Well_order s] FinFunc_def |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1271 |
by simp (metis Func_emp2 bot.extremum_uniqueI emptyE well_order_on_domain s subrelI) |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
1272 |
|
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1273 |
lemma oone_oexp: "oone ^o s =o oone" (is "?L =o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1274 |
by (rule oone_ordIso_oexp[OF ordIso_reflexive[OF oone_Well_order] s]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1275 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1276 |
lemma oexp_monoR: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1277 |
assumes "oone <o r" "s <o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1278 |
shows "r ^o s <o r ^o t" (is "?L <o ?R") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1279 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1280 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1281 |
interpret rt!: wo_rel2 r t by unfold_locales (rule r, rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1282 |
interpret rexpt!: wo_rel "r ^o t" by unfold_locales (rule rt.oexp_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1283 |
interpret r!: wo_rel r by unfold_locales (rule r) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1284 |
interpret s!: wo_rel s by unfold_locales (rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1285 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1286 |
have "Field r \<noteq> {}" by (metis assms(1) internalize_ordLess not_psubset_empty) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1287 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1288 |
{ assume "Field r = {r.zero}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1289 |
hence "r = {(r.zero, r.zero)}" using refl_onD[OF r.REFL, of r.zero] unfolding Field_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1290 |
hence "r =o oone" by (metis oone_ordIso ordIso_symmetric) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1291 |
with not_ordLess_ordIso[OF assms(1)] have False by (metis ordIso_symmetric) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1292 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1293 |
ultimately obtain x where x: "x \<in> Field r" "r.zero \<in> Field r" "x \<noteq> r.zero" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1294 |
by (metis insert_iff r.zero_in_Field subsetI subset_singletonD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1295 |
moreover from assms(2) obtain f where "embedS s t f" unfolding ordLess_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1296 |
hence *: "inj_on f (Field s)" "compat s t f" "ofilter t (f ` Field s)" "f ` Field s \<subset> Field t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1297 |
using embed_iff_compat_inj_on_ofilter[OF s t, of f] embedS_iff[OF s, of t f] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1298 |
unfolding embedS_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1299 |
note invff = the_inv_into_f_f[OF *(1)] and injfD = inj_onD[OF *(1)] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1300 |
def F \<equiv> "\<lambda>g z. if z \<in> f ` Field s then g (the_inv_into (Field s) f z) else |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1301 |
if z \<in> Field t then r.zero else undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1302 |
from *(4) x(2) the_inv_into_f_eq[OF *(1)] have FLR: "F ` Field ?L \<subseteq> Field ?R" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1303 |
unfolding rt.Field_oexp rs.Field_oexp FinFunc_def Func_def fin_support_def support_def F_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1304 |
by (fastforce split: option.splits split_if_asm elim!: finite_surj[of _ _ f]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1305 |
have "inj_on F (Field ?L)" unfolding rs.Field_oexp inj_on_def fun_eq_iff |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1306 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1307 |
fix g h x assume "g \<in> FinFunc r s" "h \<in> FinFunc r s" "\<forall>y. F g y = F h y" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1308 |
with invff show "g x = h x" unfolding F_def fun_eq_iff FinFunc_def Func_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1309 |
by auto (metis image_eqI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1310 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1311 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1312 |
have "compat ?L ?R F" unfolding compat_def rs.oexp_def rt.oexp_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1313 |
proof (safe elim!: bspec[OF iffD1[OF image_subset_iff FLR[unfolded rs.Field_oexp rt.Field_oexp]]]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1314 |
fix g h assume gh: "g \<in> FinFunc r s" "h \<in> FinFunc r s" "F g \<noteq> F h" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1315 |
"let m = s.max_fun_diff g h in (g m, h m) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1316 |
hence "g \<noteq> h" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1317 |
note max_fun_diff_in = rs.max_fun_diff_in[OF `g \<noteq> h` gh(1,2)] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1318 |
and max_fun_diff_max = rs.max_fun_diff_max[OF `g \<noteq> h` gh(1,2)] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1319 |
with *(4) invff *(2) have "t.max_fun_diff (F g) (F h) = f (s.max_fun_diff g h)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1320 |
unfolding t.max_fun_diff_def compat_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1321 |
by (intro t.maxim_equality) (auto simp: t.isMaxim_def F_def dest: injfD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1322 |
with gh invff max_fun_diff_in |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1323 |
show "let m = t.max_fun_diff (F g) (F h) in (F g m, F h m) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1324 |
unfolding F_def Let_def by (auto simp: dest: injfD) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1325 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1326 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1327 |
from FLR have "ofilter ?R (F ` Field ?L)" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1328 |
unfolding rexpt.ofilter_def under_def rs.Field_oexp rt.Field_oexp unfolding rt.oexp_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1329 |
proof (safe elim!: imageI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1330 |
fix g h assume gh: "g \<in> FinFunc r s" "h \<in> FinFunc r t" "F g \<in> FinFunc r t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1331 |
"let m = t.max_fun_diff h (F g) in (h m, F g m) \<in> r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1332 |
thus "h \<in> F ` FinFunc r s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1333 |
proof (cases "h = F g") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1334 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1335 |
hence max_Field: "t.max_fun_diff h (F g) \<in> {a \<in> Field t. h a \<noteq> F g a}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1336 |
by (rule rt.max_fun_diff_in[OF _ gh(2,3)]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1337 |
{ assume *: "t.max_fun_diff h (F g) \<notin> f ` Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1338 |
with max_Field have "F g (t.max_fun_diff h (F g)) = r.zero" unfolding F_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1339 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1340 |
with * gh(4) have "h (t.max_fun_diff h (F g)) = r.zero" unfolding Let_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1341 |
ultimately have False using max_Field gh(2,3) unfolding FinFunc_def Func_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1342 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1343 |
hence max_f_Field: "t.max_fun_diff h (F g) \<in> f ` Field s" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1344 |
{ fix z assume z: "z \<in> Field t - f ` Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1345 |
have "(t.max_fun_diff h (F g), z) \<in> t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1346 |
proof (rule ccontr) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1347 |
assume "(t.max_fun_diff h (F g), z) \<notin> t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1348 |
hence "(z, t.max_fun_diff h (F g)) \<in> t" using t.in_notinI[of "t.max_fun_diff h (F g)" z] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1349 |
z max_Field by auto |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1350 |
hence "z \<in> f ` Field s" using *(3) max_f_Field unfolding t.ofilter_def under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1351 |
by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1352 |
with z show False by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1353 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1354 |
hence "h z = r.zero" using rt.max_fun_diff_le_eq[OF _ False gh(2,3), of z] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1355 |
z max_f_Field unfolding F_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1356 |
} note ** = this |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1357 |
with *(3) gh(2) have "h = F (\<lambda>x. if x \<in> Field s then h (f x) else undefined)" using invff |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1358 |
unfolding F_def fun_eq_iff FinFunc_def Func_def Let_def t.ofilter_def under_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1359 |
moreover from gh(2) *(1,3) have "(\<lambda>x. if x \<in> Field s then h (f x) else undefined) \<in> FinFunc r s" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1360 |
unfolding FinFunc_def Func_def fin_support_def support_def t.ofilter_def under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1361 |
by (auto intro: subset_inj_on elim!: finite_imageD[OF finite_subset[rotated]]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1362 |
ultimately show "?thesis" by (rule image_eqI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1363 |
qed simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1364 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1365 |
ultimately have "embed ?L ?R F" using embed_iff_compat_inj_on_ofilter[of ?L ?R F] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1366 |
by (auto intro: oexp_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1367 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1368 |
from FLR have "F ` Field ?L \<subset> Field ?R" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1369 |
proof (intro psubsetI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1370 |
from *(4) obtain z where z: "z \<in> Field t" "z \<notin> f ` Field s" by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1371 |
def h \<equiv> "\<lambda>z'. if z' \<in> Field t then if z' = z then x else r.zero else undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1372 |
from z x(3) have "rt.SUPP h = {z}" unfolding support_def h_def by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1373 |
with x have "h \<in> Field ?R" unfolding h_def rt.Field_oexp FinFunc_def Func_def fin_support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1374 |
by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1375 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1376 |
{ fix g |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1377 |
from z have "F g z = r.zero" "h z = x" unfolding support_def h_def F_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1378 |
with x(3) have "F g \<noteq> h" unfolding fun_eq_iff by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1379 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1380 |
hence "h \<notin> F ` Field ?L" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1381 |
ultimately show "F ` Field ?L \<noteq> Field ?R" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1382 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1383 |
ultimately have "embedS ?L ?R F" using embedS_iff[OF rs.oexp_Well_order, of ?R F] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1384 |
thus ?thesis unfolding ordLess_def using r s t by (auto intro: oexp_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1385 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1386 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1387 |
lemma oexp_monoL: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1388 |
assumes "r \<le>o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1389 |
shows "r ^o t \<le>o s ^o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1390 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1391 |
interpret rt!: wo_rel2 r t by unfold_locales (rule r, rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1392 |
interpret st!: wo_rel2 s t by unfold_locales (rule s, rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1393 |
interpret r!: wo_rel r by unfold_locales (rule r) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1394 |
interpret s!: wo_rel s by unfold_locales (rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1395 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1396 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1397 |
proof (cases "t = {}") |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1398 |
case True thus ?thesis using r s unfolding ordLeq_def2 underS_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1399 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1400 |
case False thus ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1401 |
proof (cases "r = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1402 |
case True thus ?thesis using t `t \<noteq> {}` st.oexp_Well_order ozero_ordLeq[unfolded ozero_def] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1403 |
by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1404 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1405 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1406 |
from assms obtain f where f: "embed r s f" unfolding ordLeq_def by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1407 |
hence f_underS: "\<forall>a\<in>Field r. f a \<in> Field s \<and> f ` underS r a \<subseteq> underS s (f a)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1408 |
using embed_in_Field[OF rt.rWELL f] embed_underS2[OF rt.rWELL st.rWELL f] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1409 |
from f `t \<noteq> {}` False have *: "Field r \<noteq> {}" "Field s \<noteq> {}" "Field t \<noteq> {}" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1410 |
unfolding Field_def embed_def under_def bij_betw_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1411 |
with f obtain x where "s.zero = f x" "x \<in> Field r" unfolding embed_def bij_betw_def |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1412 |
using embed_in_Field[OF r.WELL f] s.zero_under set_mp[OF under_Field[of r]] by blast |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1413 |
with f have fz: "f r.zero = s.zero" and inj: "inj_on f (Field r)" and compat: "compat r s f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1414 |
unfolding embed_iff_compat_inj_on_ofilter[OF r s] compat_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1415 |
by (fastforce intro: s.leq_zero_imp)+ |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1416 |
let ?f = "\<lambda>g x. if x \<in> Field t then f (g x) else undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1417 |
{ fix g assume g: "g \<in> Field (r ^o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1418 |
with fz f_underS have Field_fg: "?f g \<in> Field (s ^o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1419 |
unfolding st.Field_oexp rt.Field_oexp FinFunc_def Func_def fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1420 |
by (auto elim!: finite_subset[rotated]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1421 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1422 |
have "?f ` underS (r ^o t) g \<subseteq> underS (s ^o t) (?f g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1423 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1424 |
fix h |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1425 |
assume h_underS: "h \<in> underS (r ^o t) g" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1426 |
hence "h \<in> Field (r ^o t)" unfolding underS_def Field_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1427 |
with fz f_underS have Field_fh: "?f h \<in> Field (s ^o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1428 |
unfolding st.Field_oexp rt.Field_oexp FinFunc_def Func_def fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1429 |
by (auto elim!: finite_subset[rotated]) |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1430 |
from h_underS have "h \<noteq> g" and hg: "(h, g) \<in> rt.oexp" unfolding underS_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1431 |
with f inj have neq: "?f h \<noteq> ?f g" |
55466 | 1432 |
unfolding fun_eq_iff inj_on_def rt.oexp_def map_option_case FinFunc_def Func_def Let_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1433 |
by simp metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1434 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1435 |
with hg have "t.max_fun_diff (?f h) (?f g) = t.max_fun_diff h g" unfolding rt.oexp_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1436 |
using rt.max_fun_diff[OF `h \<noteq> g`] rt.max_fun_diff_in[OF `h \<noteq> g`] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1437 |
by (subst t.max_fun_diff_def, intro t.maxim_equality) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1438 |
(auto simp: t.isMaxim_def intro: inj_onD[OF inj] intro!: rt.max_fun_diff_max) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1439 |
with Field_fg Field_fh hg fz f_underS compat neq have "(?f h, ?f g) \<in> st.oexp" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1440 |
using rt.max_fun_diff[OF `h \<noteq> g`] rt.max_fun_diff_in[OF `h \<noteq> g`] unfolding st.Field_oexp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1441 |
unfolding rt.oexp_def st.oexp_def Let_def compat_def by auto |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1442 |
ultimately show "?f h \<in> underS (s ^o t) (?f g)" unfolding underS_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1443 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1444 |
ultimately have "?f g \<in> Field (s ^o t) \<and> ?f ` underS (r ^o t) g \<subseteq> underS (s ^o t) (?f g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1445 |
by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1446 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1447 |
thus ?thesis unfolding ordLeq_def2 by (fastforce intro: oexp_Well_order r s t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1448 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1449 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1450 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1451 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1452 |
lemma ordLeq_oexp2: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1453 |
assumes "oone <o r" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1454 |
shows "s \<le>o r ^o s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1455 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1456 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1457 |
interpret r!: wo_rel r by unfold_locales (rule r) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1458 |
interpret s!: wo_rel s by unfold_locales (rule s) |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1459 |
from assms well_order_on_domain[OF r] obtain x where |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1460 |
x: "x \<in> Field r" "r.zero \<in> Field r" "x \<noteq> r.zero" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1461 |
unfolding ordLess_def oone_def embedS_def[abs_def] bij_betw_def embed_def under_def |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1462 |
by (auto simp: image_def) |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1463 |
(metis (lifting) equals0D mem_Collect_eq r.zero_in_Field singletonI) |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1464 |
let ?f = "\<lambda>a b. if b \<in> Field s then if b = a then x else r.zero else undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1465 |
from x(3) have SUPP: "\<And>y. y \<in> Field s \<Longrightarrow> rs.SUPP (?f y) = {y}" unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1466 |
{ fix y assume y: "y \<in> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1467 |
with x(1,2) SUPP have "?f y \<in> Field (r ^o s)" unfolding rs.Field_oexp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1468 |
by (auto simp: FinFunc_def Func_def fin_support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1469 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1470 |
have "?f ` underS s y \<subseteq> underS (r ^o s) (?f y)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1471 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1472 |
fix z |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1473 |
assume "z \<in> underS s y" |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1474 |
hence z: "z \<noteq> y" "(z, y) \<in> s" "z \<in> Field s" unfolding underS_def Field_def by auto |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1475 |
from x(3) y z(1,3) have "?f z \<noteq> ?f y" unfolding fun_eq_iff by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1476 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1477 |
{ from x(1,2) have "?f z \<in> FinFunc r s" "?f y \<in> FinFunc r s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1478 |
unfolding FinFunc_def Func_def fin_support_def by (auto simp: SUPP[OF z(3)] SUPP[OF y]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1479 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1480 |
from x(3) y z(1,2) refl_onD[OF s.REFL] have "s.max_fun_diff (?f z) (?f y) = y" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1481 |
unfolding rs.max_fun_diff_alt SUPP[OF z(3)] SUPP[OF y] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1482 |
by (intro s.maxim_equality) (auto simp: s.isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1483 |
ultimately have "(?f z, ?f y) \<in> rs.oexp" using y x(1) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1484 |
unfolding rs.oexp_def Let_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1485 |
} |
55023
38db7814481d
get rid of 'rel' locale, to facilitate inclusion of 'Order_Relation_More_FP' into 'Order_Relation'
blanchet
parents:
54980
diff
changeset
|
1486 |
ultimately show "?f z \<in> underS (r ^o s) (?f y)" unfolding underS_def by blast |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1487 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1488 |
ultimately have "?f y \<in> Field (r ^o s) \<and> ?f ` underS s y \<subseteq> underS (r ^o s) (?f y)" by blast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1489 |
} |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1490 |
thus ?thesis unfolding ordLeq_def2 by (fast intro: oexp_Well_order r s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1491 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1492 |
|
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
1493 |
lemma FinFunc_osum: |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1494 |
"fg \<in> FinFunc r (s +o t) = (fg o Inl \<in> FinFunc r s \<and> fg o Inr \<in> FinFunc r t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1495 |
(is "?L = (?R1 \<and> ?R2)") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1496 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1497 |
assume ?L |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1498 |
from `?L` show ?R1 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1499 |
by (auto split: sum.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1500 |
from `?L` show ?R2 unfolding FinFunc_def Field_osum Func_def Int_iff fin_support_Field_osum o_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1501 |
by (auto split: sum.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1502 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1503 |
assume ?R1 ?R2 |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1504 |
thus "?L" unfolding FinFunc_def Field_osum Func_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1505 |
by (auto simp: fin_support_Field_osum o_def image_iff split: sum.splits) (metis sumE) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1506 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1507 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1508 |
lemma max_fun_diff_eq_Inl: |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1509 |
assumes "wo_rel.max_fun_diff (s +o t) (case_sum f1 g1) (case_sum f2 g2) = Inl x" |
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1510 |
"case_sum f1 g1 \<noteq> case_sum f2 g2" |
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1511 |
"case_sum f1 g1 \<in> FinFunc r (s +o t)" "case_sum f2 g2 \<in> FinFunc r (s +o t)" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1512 |
shows "wo_rel.max_fun_diff s f1 f2 = x" (is ?P) "g1 = g2" (is ?Q) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1513 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1514 |
interpret st!: wo_rel "s +o t" by unfold_locales (rule osum_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1515 |
interpret s!: wo_rel s by unfold_locales (rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1516 |
interpret rst!: wo_rel2 r "s +o t" by unfold_locales (rule r, rule osum_Well_order[OF s t]) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1517 |
from assms(1) have *: "st.isMaxim {a \<in> Field (s +o t). case_sum f1 g1 a \<noteq> case_sum f2 g2 a} (Inl x)" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1518 |
using rst.isMaxim_max_fun_diff[OF assms(2-4)] by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1519 |
hence "s.isMaxim {a \<in> Field s. f1 a \<noteq> f2 a} x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1520 |
unfolding st.isMaxim_def s.isMaxim_def Field_osum by (auto simp: osum_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1521 |
thus ?P unfolding s.max_fun_diff_def by (rule s.maxim_equality) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1522 |
from assms(3,4) have **: "g1 \<in> FinFunc r t" "g2 \<in> FinFunc r t" unfolding FinFunc_osum |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1523 |
by (auto simp: o_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1524 |
show ?Q |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1525 |
proof |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1526 |
fix x |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1527 |
from * ** show "g1 x = g2 x" unfolding st.isMaxim_def Field_osum FinFunc_def Func_def fun_eq_iff |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1528 |
unfolding osum_def by (case_tac "x \<in> Field t") auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1529 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1530 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1531 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1532 |
lemma max_fun_diff_eq_Inr: |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1533 |
assumes "wo_rel.max_fun_diff (s +o t) (case_sum f1 g1) (case_sum f2 g2) = Inr x" |
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1534 |
"case_sum f1 g1 \<noteq> case_sum f2 g2" |
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1535 |
"case_sum f1 g1 \<in> FinFunc r (s +o t)" "case_sum f2 g2 \<in> FinFunc r (s +o t)" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1536 |
shows "wo_rel.max_fun_diff t g1 g2 = x" (is ?P) "g1 \<noteq> g2" (is ?Q) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1537 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1538 |
interpret st!: wo_rel "s +o t" by unfold_locales (rule osum_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1539 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1540 |
interpret rst!: wo_rel2 r "s +o t" by unfold_locales (rule r, rule osum_Well_order[OF s t]) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1541 |
from assms(1) have *: "st.isMaxim {a \<in> Field (s +o t). case_sum f1 g1 a \<noteq> case_sum f2 g2 a} (Inr x)" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1542 |
using rst.isMaxim_max_fun_diff[OF assms(2-4)] by simp |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1543 |
hence "t.isMaxim {a \<in> Field t. g1 a \<noteq> g2 a} x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1544 |
unfolding st.isMaxim_def t.isMaxim_def Field_osum by (auto simp: osum_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1545 |
thus ?P ?Q unfolding t.max_fun_diff_def fun_eq_iff |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1546 |
by (auto intro: t.maxim_equality simp: t.isMaxim_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1547 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1548 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1549 |
lemma oexp_osum: "r ^o (s +o t) =o (r ^o s) *o (r ^o t)" (is "?R =o ?L") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1550 |
proof (rule ordIso_symmetric) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1551 |
interpret rst!: wo_rel2 r "s +o t" by unfold_locales (rule r, rule osum_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1552 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1553 |
interpret rt!: wo_rel2 r t by unfold_locales (rule r, rule t) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
55102
diff
changeset
|
1554 |
let ?f = "\<lambda>(f, g). case_sum f g" |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1555 |
have "bij_betw ?f (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1556 |
unfolding bij_betw_def rst.Field_oexp rs.Field_oexp rt.Field_oexp Field_oprod proof (intro conjI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1557 |
show "inj_on ?f (FinFunc r s \<times> FinFunc r t)" unfolding inj_on_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1558 |
by (auto simp: fun_eq_iff split: sum.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1559 |
show "?f ` (FinFunc r s \<times> FinFunc r t) = FinFunc r (s +o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1560 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1561 |
fix fg assume "fg \<in> FinFunc r (s +o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1562 |
thus "fg \<in> ?f ` (FinFunc r s \<times> FinFunc r t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1563 |
by (intro image_eqI[of _ _ "(fg o Inl, fg o Inr)"]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1564 |
(auto simp: FinFunc_osum fun_eq_iff split: sum.splits) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1565 |
qed (auto simp: FinFunc_osum o_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1566 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1567 |
moreover have "compat ?L ?R ?f" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1568 |
unfolding compat_def rst.Field_oexp rs.Field_oexp rt.Field_oexp oprod_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1569 |
unfolding rst.oexp_def Let_def rs.oexp_def rt.oexp_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1570 |
by (fastforce simp: Field_osum FinFunc_osum o_def split: sum.splits |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1571 |
dest: max_fun_diff_eq_Inl max_fun_diff_eq_Inr) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1572 |
ultimately have "iso ?L ?R ?f" using r s t |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1573 |
by (subst iso_iff3) (auto intro: oexp_Well_order oprod_Well_order osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1574 |
thus "?L =o ?R" using r s t unfolding ordIso_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1575 |
by (auto intro: oexp_Well_order oprod_Well_order osum_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1576 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1577 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1578 |
definition "rev_curr f b = (if b \<in> Field t then \<lambda>a. f (a, b) else undefined)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1579 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1580 |
lemma rev_curr_FinFunc: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1581 |
assumes Field: "Field r \<noteq> {}" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1582 |
shows "rev_curr ` (FinFunc r (s *o t)) = FinFunc (r ^o s) t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1583 |
proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1584 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1585 |
interpret rst!: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1586 |
fix g assume g: "g \<in> FinFunc r (s *o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1587 |
hence "finite (rst.SUPP (rev_curr g))" "\<forall>x \<in> Field t. finite (rs.SUPP (rev_curr g x))" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1588 |
unfolding FinFunc_def Field_oprod rs.Field_oexp Func_def fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1589 |
rs.zero_oexp[OF Field] rev_curr_def by (auto simp: fun_eq_iff rs.const_def elim!: finite_surj) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1590 |
with g show "rev_curr g \<in> FinFunc (r ^o s) t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1591 |
unfolding FinFunc_def Field_oprod rs.Field_oexp Func_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1592 |
by (auto simp: rev_curr_def fin_support_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1593 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1594 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1595 |
interpret rst!: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1596 |
fix fg assume *: "fg \<in> FinFunc (r ^o s) t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1597 |
let ?g = "\<lambda>(a, b). if (a, b) \<in> Field (s *o t) then fg b a else undefined" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1598 |
show "fg \<in> rev_curr ` FinFunc r (s *o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1599 |
proof (rule image_eqI[of _ _ ?g]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1600 |
show "fg = rev_curr ?g" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1601 |
proof |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1602 |
fix x |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1603 |
from * show "fg x = rev_curr ?g x" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1604 |
unfolding FinFunc_def rs.Field_oexp Func_def rev_curr_def Field_oprod by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1605 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1606 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1607 |
have **: "(\<Union>g \<in> fg ` Field t. rs.SUPP g) = |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1608 |
(\<Union>g \<in> fg ` Field t - {rs.const}. rs.SUPP g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1609 |
unfolding support_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1610 |
from * have "\<forall>g \<in> fg ` Field t. finite (rs.SUPP g)" "finite (rst.SUPP fg)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1611 |
unfolding rs.Field_oexp FinFunc_def Func_def fin_support_def these_def by force+ |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1612 |
moreover hence "finite (fg ` Field t - {rs.const})" using * |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1613 |
unfolding support_def rs.zero_oexp[OF Field] FinFunc_def Func_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1614 |
by (elim finite_surj[of _ _ fg]) (fastforce simp: image_iff these_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1615 |
ultimately have "finite ((\<Union>g \<in> fg ` Field t. rs.SUPP g) \<times> rst.SUPP fg)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1616 |
by (subst **) (auto intro!: finite_cartesian_product) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1617 |
with * show "?g \<in> FinFunc r (s *o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1618 |
unfolding Field_oprod rs.Field_oexp FinFunc_def Func_def fin_support_def these_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1619 |
support_def rs.zero_oexp[OF Field] by (auto elim!: finite_subset[rotated]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1620 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1621 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1622 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1623 |
lemma rev_curr_app_FinFunc[elim!]: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1624 |
"\<lbrakk>f \<in> FinFunc r (s *o t); z \<in> Field t\<rbrakk> \<Longrightarrow> rev_curr f z \<in> FinFunc r s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1625 |
unfolding rev_curr_def FinFunc_def Func_def Field_oprod fin_support_def support_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1626 |
by (auto elim: finite_surj) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1627 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1628 |
lemma max_fun_diff_oprod: |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1629 |
assumes Field: "Field r \<noteq> {}" and "f \<noteq> g" "f \<in> FinFunc r (s *o t)" "g \<in> FinFunc r (s *o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1630 |
defines "m \<equiv> wo_rel.max_fun_diff t (rev_curr f) (rev_curr g)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1631 |
shows "wo_rel.max_fun_diff (s *o t) f g = |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1632 |
(wo_rel.max_fun_diff s (rev_curr f m) (rev_curr g m), m)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1633 |
proof - |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1634 |
interpret st!: wo_rel "s *o t" by unfold_locales (rule oprod_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1635 |
interpret s!: wo_rel s by unfold_locales (rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1636 |
interpret t!: wo_rel t by unfold_locales (rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1637 |
interpret r_st!: wo_rel2 r "s *o t" by unfold_locales (rule r, rule oprod_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1638 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1639 |
interpret rst!: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1640 |
from fun_unequal_in_support[OF assms(2), of "Field (s *o t)" "Field r" "Field r"] assms(3,4) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1641 |
have diff1: "rev_curr f \<noteq> rev_curr g" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1642 |
"rev_curr f \<in> FinFunc (r ^o s) t" "rev_curr g \<in> FinFunc (r ^o s) t" using rev_curr_FinFunc[OF Field] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1643 |
unfolding fun_eq_iff rev_curr_def[abs_def] FinFunc_def support_def Field_oprod |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1644 |
by auto fast |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1645 |
hence diff2: "rev_curr f m \<noteq> rev_curr g m" "rev_curr f m \<in> FinFunc r s" "rev_curr g m \<in> FinFunc r s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1646 |
using rst.max_fun_diff[OF diff1] assms(3,4) rst.max_fun_diff_in unfolding m_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1647 |
show ?thesis unfolding st.max_fun_diff_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1648 |
proof (intro st.maxim_equality, unfold st.isMaxim_def Field_oprod, safe) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1649 |
show "s.max_fun_diff (rev_curr f m) (rev_curr g m) \<in> Field s" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1650 |
using rs.max_fun_diff_in[OF diff2] by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1651 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1652 |
show "m \<in> Field t" using rst.max_fun_diff_in[OF diff1] unfolding m_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1653 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1654 |
assume "f (s.max_fun_diff (rev_curr f m) (rev_curr g m), m) = |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1655 |
g (s.max_fun_diff (rev_curr f m) (rev_curr g m), m)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1656 |
(is "f (?x, m) = g (?x, m)") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1657 |
hence "rev_curr f m ?x = rev_curr g m ?x" unfolding rev_curr_def by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1658 |
with rs.max_fun_diff[OF diff2] show False by auto |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1659 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1660 |
fix x y assume "f (x, y) \<noteq> g (x, y)" "x \<in> Field s" "y \<in> Field t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1661 |
thus "((x, y), (s.max_fun_diff (rev_curr f m) (rev_curr g m), m)) \<in> s *o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1662 |
using rst.max_fun_diff_in[OF diff1] rs.max_fun_diff_in[OF diff2] diff1 diff2 |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1663 |
rst.max_fun_diff_max[OF diff1, of y] rs.max_fun_diff_le_eq[OF _ diff2, of x] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1664 |
unfolding oprod_def m_def rev_curr_def fun_eq_iff by auto (metis s.in_notinI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1665 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1666 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1667 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1668 |
lemma oexp_oexp: "(r ^o s) ^o t =o r ^o (s *o t)" (is "?R =o ?L") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1669 |
proof (cases "r = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1670 |
case True |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1671 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1672 |
interpret rst!: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1673 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1674 |
proof (cases "s = {} \<or> t = {}") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1675 |
case True with `r = {}` show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1676 |
by (auto simp: oexp_empty[OF oexp_Well_order[OF Well_order_empty s]] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1677 |
intro!: ordIso_transitive[OF ordIso_symmetric[OF oone_ordIso] oone_ordIso] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1678 |
ordIso_transitive[OF oone_ordIso_oexp[OF ordIso_symmetric[OF oone_ordIso] t] oone_ordIso]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1679 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1680 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1681 |
moreover hence "s *o t \<noteq> {}" unfolding oprod_def Field_def by fastforce |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1682 |
ultimately show ?thesis using `r = {}` ozero_ordIso |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1683 |
by (auto simp add: s t oprod_Well_order ozero_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1684 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1685 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1686 |
case False |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1687 |
hence Field: "Field r \<noteq> {}" by (metis Field_def Range_empty_iff Un_empty) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1688 |
show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1689 |
proof (rule ordIso_symmetric) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1690 |
interpret r_st!: wo_rel2 r "s *o t" by unfold_locales (rule r, rule oprod_Well_order[OF s t]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1691 |
interpret rs!: wo_rel2 r s by unfold_locales (rule r, rule s) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1692 |
interpret rst!: wo_rel2 "r ^o s" t by unfold_locales (rule oexp_Well_order[OF r s], rule t) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1693 |
have bij: "bij_betw rev_curr (Field ?L) (Field ?R)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1694 |
unfolding bij_betw_def r_st.Field_oexp rst.Field_oexp Field_oprod proof (intro conjI) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1695 |
show "inj_on rev_curr (FinFunc r (s *o t))" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1696 |
unfolding inj_on_def FinFunc_def Func_def Field_oprod rs.Field_oexp rev_curr_def[abs_def] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1697 |
by (auto simp: fun_eq_iff) metis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1698 |
show "rev_curr ` (FinFunc r (s *o t)) = FinFunc (r ^o s) t" by (rule rev_curr_FinFunc[OF Field]) |
58127
b7cab82f488e
renamed '(BNF_)Constructions_on_Wellorders' to '(BNF_)Wellorder_Constructions'
blanchet
parents:
55932
diff
changeset
|
1699 |
qed |
54980
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1700 |
moreover |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1701 |
have "compat ?L ?R rev_curr" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1702 |
unfolding compat_def proof safe |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1703 |
fix fg1 fg2 assume fg: "(fg1, fg2) \<in> r ^o (s *o t)" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1704 |
show "(rev_curr fg1, rev_curr fg2) \<in> r ^o s ^o t" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1705 |
proof (cases "fg1 = fg2") |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1706 |
assume "fg1 \<noteq> fg2" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1707 |
with fg show ?thesis |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1708 |
using rst.max_fun_diff_in[of "rev_curr fg1" "rev_curr fg2"] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1709 |
max_fun_diff_oprod[OF Field, of fg1 fg2] rev_curr_FinFunc[OF Field, symmetric] |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1710 |
unfolding r_st.Field_oexp rs.Field_oexp rst.Field_oexp unfolding r_st.oexp_def rst.oexp_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1711 |
by (auto simp: rs.oexp_def Let_def) (auto simp: rev_curr_def[abs_def]) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1712 |
next |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1713 |
assume "fg1 = fg2" |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1714 |
with fg bij show ?thesis unfolding r_st.Field_oexp rs.Field_oexp rst.Field_oexp bij_betw_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1715 |
by (auto simp: r_st.oexp_def rst.oexp_def) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1716 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1717 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1718 |
ultimately have "iso ?L ?R rev_curr" using r s t |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1719 |
by (subst iso_iff3) (auto intro: oexp_Well_order oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1720 |
thus "?L =o ?R" using r s t unfolding ordIso_def |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1721 |
by (auto intro: oexp_Well_order oprod_Well_order) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1722 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1723 |
qed |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1724 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1725 |
end (* context with 3 wellorders *) |
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1726 |
|
7e0573a490ee
basic ordinal arithmetic and cardinals library extension (not relevant for BNFs)
traytel
parents:
diff
changeset
|
1727 |
end |