author | chaieb |
Sun, 17 Jun 2007 13:39:27 +0200 | |
changeset 23405 | 8993b3144358 |
parent 23394 | 474ff28210c0 |
child 23416 | b73a6b72f706 |
permissions | -rw-r--r-- |
22371 | 1 |
(* Title: HOL/Library/SCT_Theorem.thy |
2 |
ID: $Id$ |
|
3 |
Author: Alexander Krauss, TU Muenchen |
|
4 |
*) |
|
5 |
||
23373 | 6 |
header "" (* FIXME proper header *) |
22665 | 7 |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
8 |
theory SCT_Theorem |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
9 |
imports Main Ramsey SCT_Misc SCT_Definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
10 |
begin |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
11 |
|
22665 | 12 |
subsection {* The size change criterion SCT *} |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
13 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
14 |
definition is_thread :: "nat \<Rightarrow> nat sequence \<Rightarrow> (nat, scg) ipath \<Rightarrow> bool" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
15 |
where |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
16 |
"is_thread n \<theta> p = (\<forall>i\<ge>n. eqlat p \<theta> i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
17 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
18 |
definition is_fthread :: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
19 |
"nat sequence \<Rightarrow> (nat, scg) ipath \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
20 |
where |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
21 |
"is_fthread \<theta> mp i j = (\<forall>k\<in>{i..<j}. eqlat mp \<theta> k)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
22 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
23 |
definition is_desc_fthread :: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
24 |
"nat sequence \<Rightarrow> (nat, scg) ipath \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
25 |
where |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
26 |
"is_desc_fthread \<theta> mp i j = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
27 |
(is_fthread \<theta> mp i j \<and> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
28 |
(\<exists>k\<in>{i..<j}. descat mp \<theta> k))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
29 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
30 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
31 |
"has_fth p i j n m = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
32 |
(\<exists>\<theta>. is_fthread \<theta> p i j \<and> \<theta> i = n \<and> \<theta> j = m)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
33 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
34 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
35 |
"has_desc_fth p i j n m = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
36 |
(\<exists>\<theta>. is_desc_fthread \<theta> p i j \<and> \<theta> i = n \<and> \<theta> j = m)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
37 |
|
22665 | 38 |
|
39 |
subsection {* Bounded graphs and threads *} |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
40 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
41 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
42 |
"bounded_scg (P::nat) (G::scg) = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
43 |
(\<forall>p e p'. has_edge G p e p' \<longrightarrow> p < P \<and> p' < P)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
44 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
45 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
46 |
"bounded_acg P ACG = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
47 |
(\<forall>n G n'. has_edge ACG n G n' \<longrightarrow> n < P \<and> n' < P \<and> bounded_scg P G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
48 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
49 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
50 |
"bounded_mp P mp = (\<forall>i. bounded_scg P (snd (mp i)))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
51 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
52 |
definition (* = finite (range \<theta>) *) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
53 |
"bounded_th (P::nat) n \<theta> = (\<forall>i>n. \<theta> i < P)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
54 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
55 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
56 |
"finite_scg (G::scg) = (\<exists>P. bounded_scg P G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
57 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
58 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
59 |
"finite_acg (A::acg) = (\<exists>P. bounded_acg P A)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
60 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
61 |
lemma "finite (insert x A) = finite A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
62 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
63 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
64 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
65 |
lemma finite_scg_finite[simp]: "finite_scg (Graph G) = finite G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
66 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
67 |
assume "finite_scg (Graph G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
68 |
thm bounded_scg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
69 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
70 |
then obtain P where bounded: "bounded_scg P (Graph G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
71 |
by (auto simp:finite_scg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
72 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
73 |
show "finite G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
74 |
proof (rule finite_subset) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
75 |
from bounded |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
76 |
show "G \<subseteq> {0 .. P - 1} \<times> { LESS, LEQ } \<times> { 0 .. P - 1}" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
77 |
apply (auto simp:bounded_scg_def has_edge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
78 |
apply force |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
79 |
apply (case_tac "aa", auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
80 |
apply force |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
81 |
done |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
82 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
83 |
show "finite \<dots>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
84 |
by (auto intro: finite_cartesian_product finite_atLeastAtMost) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
85 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
86 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
87 |
assume "finite G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
88 |
thus "finite_scg (Graph G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
89 |
proof induct |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
90 |
show "finite_scg (Graph {})" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
91 |
unfolding finite_scg_def bounded_scg_def has_edge_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
92 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
93 |
fix x G |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
94 |
assume "finite G" "x \<notin> G" "finite_scg (Graph G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
95 |
then obtain P |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
96 |
where bG: "bounded_scg P (Graph G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
97 |
by (auto simp:finite_scg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
98 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
99 |
obtain p e p' where x: "x = (p, e, p')" by (cases x, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
100 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
101 |
let ?Q = "max P (max (Suc p) (Suc p'))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
102 |
have "P \<le> ?Q" "Suc p \<le> ?Q" "Suc p' \<le> ?Q" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
103 |
with bG |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
104 |
have "bounded_scg ?Q (Graph (insert x G))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
105 |
unfolding x bounded_scg_def has_edge_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
106 |
apply simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
107 |
apply (intro allI, elim allE) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
108 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
109 |
thus "finite_scg (Graph (insert x G))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
110 |
by (auto simp:finite_scg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
111 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
112 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
113 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
114 |
lemma finite_acg_empty: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
115 |
"finite_acg (Graph {})" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
116 |
unfolding finite_acg_def bounded_acg_def has_edge_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
117 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
118 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
119 |
lemma bounded_scg_up: "bounded_scg P G \<Longrightarrow> P \<le> Q \<Longrightarrow> bounded_scg Q G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
120 |
unfolding bounded_scg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
121 |
by force |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
122 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
123 |
lemma bounded_up: "bounded_acg P G \<Longrightarrow> P \<le> Q \<Longrightarrow> bounded_acg Q G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
124 |
unfolding bounded_acg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
125 |
apply auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
126 |
apply force+ |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
127 |
apply (rule bounded_scg_up) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
128 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
129 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
130 |
lemma bacg_insert: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
131 |
assumes "bounded_acg P (Graph A)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
132 |
assumes "n < P" "m < P" "bounded_scg P G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
133 |
shows "bounded_acg P (Graph (insert (n, G, m) A))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
134 |
using prems |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
135 |
unfolding bounded_acg_def has_edge_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
136 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
137 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
138 |
lemma finite_acg_ins: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
139 |
"finite_acg (Graph (insert (n,G,m) A)) = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
140 |
(finite_scg G \<and> finite_acg (Graph A))" (is "?A = (?B \<and> ?C)") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
141 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
142 |
assume "?A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
143 |
thus "?B \<and> ?C" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
144 |
unfolding finite_acg_def bounded_acg_def finite_scg_def has_edge_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
145 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
146 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
147 |
assume "?B \<and> ?C" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
148 |
thus ?A |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
149 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
150 |
assume "?B" "?C" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
151 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
152 |
from `?C` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
153 |
obtain P where bA: "bounded_acg P (Graph A)" by (auto simp:finite_acg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
154 |
from `?B` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
155 |
obtain P' where bG: "bounded_scg P' G" by (auto simp:finite_scg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
156 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
157 |
let ?Q = "max (max P P') (max (Suc n) (Suc m))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
158 |
have "P \<le> ?Q" "n < ?Q" "m < ?Q" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
159 |
have "bounded_acg ?Q (Graph (insert (n, G, m) A))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
160 |
apply (rule bacg_insert) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
161 |
apply (rule bounded_up) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
162 |
apply (rule bA) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
163 |
apply auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
164 |
apply (rule bounded_scg_up) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
165 |
apply (rule bG) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
166 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
167 |
thus "finite_acg (Graph (insert (n, G, m) A))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
168 |
by (auto simp:finite_acg_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
169 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
170 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
171 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
172 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
173 |
lemma bounded_mpath: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
174 |
assumes "has_ipath acg mp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
175 |
and "bounded_acg P acg" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
176 |
shows "bounded_mp P mp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
177 |
using prems |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
178 |
unfolding bounded_acg_def bounded_mp_def has_ipath_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
179 |
by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
180 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
181 |
lemma bounded_th: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
182 |
assumes th: "is_thread n \<theta> mp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
183 |
and mp: "bounded_mp P mp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
184 |
shows "bounded_th P n \<theta>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
185 |
unfolding bounded_th_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
186 |
proof (intro allI impI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
187 |
fix i assume "n < i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
188 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
189 |
from mp have "bounded_scg P (snd (mp i))" unfolding bounded_mp_def .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
190 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
191 |
from th `n < i` have "eqlat mp \<theta> i" unfolding is_thread_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
192 |
ultimately |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
193 |
show "\<theta> i < P" unfolding bounded_scg_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
194 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
195 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
196 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
197 |
lemma finite_range: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
198 |
fixes f :: "nat \<Rightarrow> 'a" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
199 |
assumes fin: "finite (range f)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
200 |
shows "\<exists>x. \<exists>\<^sub>\<infinity>i. f i = x" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
201 |
proof (rule classical) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
202 |
assume "\<not>(\<exists>x. \<exists>\<^sub>\<infinity>i. f i = x)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
203 |
hence "\<forall>x. \<exists>j. \<forall>i>j. f i \<noteq> x" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
204 |
unfolding INF_nat by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
205 |
with choice |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
206 |
have "\<exists>j. \<forall>x. \<forall>i>(j x). f i \<noteq> x" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
207 |
then obtain j where |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
208 |
neq: "\<And>x i. j x < i \<Longrightarrow> f i \<noteq> x" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
209 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
210 |
from fin have "finite (range (j o f))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
211 |
by (auto simp:comp_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
212 |
with finite_nat_bounded |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
213 |
obtain m where "range (j o f) \<subseteq> {..<m}" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
214 |
hence "j (f m) < m" unfolding comp_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
215 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
216 |
with neq[of "f m" m] show ?thesis by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
217 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
218 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
219 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
220 |
lemma bounded_th_infinite_visit: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
221 |
fixes \<theta> :: "nat sequence" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
222 |
assumes b: "bounded_th P n \<theta>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
223 |
shows "\<exists>p. \<exists>\<^sub>\<infinity>i. \<theta> i = p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
224 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
225 |
have split: "range \<theta> = (\<theta> ` {0 .. n}) \<union> (\<theta> ` {i. n < i})" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
226 |
(is "\<dots> = ?A \<union> ?B") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
227 |
unfolding image_Un[symmetric] by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
228 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
229 |
have "finite ?A" by (rule finite_imageI) auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
230 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
231 |
have "finite ?B" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
232 |
proof (rule finite_subset) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
233 |
from b |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
234 |
show "?B \<subseteq> { 0 ..< P }" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
235 |
unfolding bounded_th_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
236 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
237 |
show "finite \<dots>" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
238 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
239 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
240 |
ultimately have "finite (range \<theta>)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
241 |
unfolding split by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
242 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
243 |
with finite_range show ?thesis . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
244 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
245 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
246 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
247 |
lemma bounded_scgcomp: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
248 |
"bounded_scg P A |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
249 |
\<Longrightarrow> bounded_scg P B |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
250 |
\<Longrightarrow> bounded_scg P (A * B)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
251 |
unfolding bounded_scg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
252 |
by (auto simp:in_grcomp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
253 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
254 |
lemma bounded_acgcomp: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
255 |
"bounded_acg P A |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
256 |
\<Longrightarrow> bounded_acg P B |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
257 |
\<Longrightarrow> bounded_acg P (A * B)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
258 |
unfolding bounded_acg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
259 |
by (auto simp:in_grcomp intro!:bounded_scgcomp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
260 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
261 |
lemma bounded_acgpow: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
262 |
"bounded_acg P A |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
263 |
\<Longrightarrow> bounded_acg P (A ^ (Suc n))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
264 |
by (induct n, simp add:power_Suc) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
265 |
(subst power_Suc, blast intro:bounded_acgcomp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
266 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
267 |
lemma bounded_plus: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
268 |
assumes b: "bounded_acg P acg" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
269 |
shows "bounded_acg P (tcl acg)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
270 |
unfolding bounded_acg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
271 |
proof (intro allI impI conjI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
272 |
fix n G m |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
273 |
assume "tcl acg \<turnstile> n \<leadsto>\<^bsup>G\<^esup> m" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
274 |
then obtain i where "0 < i" and i: "acg ^ i \<turnstile> n \<leadsto>\<^bsup>G\<^esup> m" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
275 |
unfolding in_tcl by auto (* FIXME: Disambiguate \<turnstile> Grammar *) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
276 |
from b have "bounded_acg P (acg ^ (Suc (i - 1)))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
277 |
by (rule bounded_acgpow) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
278 |
with `0 < i` have "bounded_acg P (acg ^ i)" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
279 |
with i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
280 |
show "n < P" "m < P" "bounded_scg P G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
281 |
unfolding bounded_acg_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
282 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
283 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
284 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
285 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
286 |
lemma bounded_scg_def': |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
287 |
"bounded_scg P G = (\<forall>(p,e,p')\<in>dest_graph G. p < P \<and> p' < P)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
288 |
unfolding bounded_scg_def has_edge_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
289 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
290 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
291 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
292 |
lemma finite_bounded_scg: "finite { G. bounded_scg P G }" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
293 |
proof (rule finite_subset) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
294 |
show "{G. bounded_scg P G} \<subseteq> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
295 |
Graph ` (Pow ({0 .. P - 1} \<times> UNIV \<times> {0 .. P - 1}))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
296 |
proof (rule, simp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
297 |
fix G |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
298 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
299 |
assume b: "bounded_scg P G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
300 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
301 |
show "G \<in> Graph ` Pow ({0..P - Suc 0} \<times> UNIV \<times> {0..P - Suc 0})" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
302 |
proof (cases G) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
303 |
fix G' assume [simp]: "G = Graph G'" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
304 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
305 |
from b show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
306 |
by (auto simp:bounded_scg_def' image_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
307 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
308 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
309 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
310 |
show "finite \<dots>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
311 |
apply (rule finite_imageI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
312 |
apply (unfold finite_Pow_iff) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
313 |
by (intro finite_cartesian_product finite_atLeastAtMost |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
314 |
finite_class.finite) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
315 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
316 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
317 |
lemma bounded_finite: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
318 |
assumes bounded: "bounded_acg P A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
319 |
shows "finite (dest_graph A)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
320 |
proof (rule finite_subset) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
321 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
322 |
from bounded |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
323 |
show "dest_graph A \<subseteq> {0 .. P - 1} \<times> { G. bounded_scg P G } \<times> { 0 .. P - 1}" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
324 |
by (auto simp:bounded_acg_def has_edge_def) force+ |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
325 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
326 |
show "finite \<dots>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
327 |
by (intro finite_cartesian_product finite_atLeastAtMost finite_bounded_scg) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
328 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
329 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
330 |
|
22665 | 331 |
subsection {* Contraction and more *} |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
332 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
333 |
abbreviation |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
334 |
"pdesc P == (fst P, prod P, end_node P)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
335 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
336 |
lemma pdesc_acgplus: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
337 |
assumes "has_ipath \<A> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
338 |
and "i < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
339 |
shows "has_edge (tcl \<A>) (fst (p\<langle>i,j\<rangle>)) (prod (p\<langle>i,j\<rangle>)) (end_node (p\<langle>i,j\<rangle>))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
340 |
unfolding plus_paths |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
341 |
apply (rule exI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
342 |
apply (insert prems) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
343 |
by (auto intro:sub_path_is_path[of "\<A>" p i j] simp:sub_path_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
344 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
345 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
346 |
lemma combine_fthreads: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
347 |
assumes range: "i < j" "j \<le> k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
348 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
349 |
"has_fth p i k m r = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
350 |
(\<exists>n. has_fth p i j m n \<and> has_fth p j k n r)" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
351 |
proof (intro iffI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
352 |
assume "?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
353 |
then obtain \<theta> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
354 |
where "is_fthread \<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
355 |
and [simp]: "\<theta> i = m" "\<theta> k = r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
356 |
by (auto simp:has_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
357 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
358 |
with range |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
359 |
have "is_fthread \<theta> p i j" and "is_fthread \<theta> p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
360 |
by (auto simp:is_fthread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
361 |
hence "has_fth p i j m (\<theta> j)" and "has_fth p j k (\<theta> j) r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
362 |
by (auto simp:has_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
363 |
thus "?R" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
364 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
365 |
assume "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
366 |
then obtain n \<theta>1 \<theta>2 |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
367 |
where ths: "is_fthread \<theta>1 p i j" "is_fthread \<theta>2 p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
368 |
and [simp]: "\<theta>1 i = m" "\<theta>1 j = n" "\<theta>2 j = n" "\<theta>2 k = r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
369 |
by (auto simp:has_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
370 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
371 |
let ?\<theta> = "(\<lambda>i. if i < j then \<theta>1 i else \<theta>2 i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
372 |
have "is_fthread ?\<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
373 |
unfolding is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
374 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
375 |
fix l assume range: "l \<in> {i..<k}" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
376 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
377 |
show "eqlat p ?\<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
378 |
proof (cases rule:three_cases) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
379 |
assume "Suc l < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
380 |
with ths range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
381 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
382 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
383 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
384 |
assume "Suc l = j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
385 |
hence "l < j" "\<theta>2 (Suc l) = \<theta>1 (Suc l)" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
386 |
with ths range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
387 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
388 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
389 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
390 |
assume "j \<le> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
391 |
with ths range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
392 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
393 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
394 |
qed arith |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
395 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
396 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
397 |
have "?\<theta> i = m" "?\<theta> k = r" using range by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
398 |
ultimately show "has_fth p i k m r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
399 |
by (auto simp:has_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
400 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
401 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
402 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
403 |
lemma desc_is_fthread: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
404 |
"is_desc_fthread \<theta> p i k \<Longrightarrow> is_fthread \<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
405 |
unfolding is_desc_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
406 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
407 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
408 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
409 |
lemma combine_dfthreads: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
410 |
assumes range: "i < j" "j \<le> k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
411 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
412 |
"has_desc_fth p i k m r = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
413 |
(\<exists>n. (has_desc_fth p i j m n \<and> has_fth p j k n r) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
414 |
\<or> (has_fth p i j m n \<and> has_desc_fth p j k n r))" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
415 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
416 |
assume "?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
417 |
then obtain \<theta> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
418 |
where desc: "is_desc_fthread \<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
419 |
and [simp]: "\<theta> i = m" "\<theta> k = r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
420 |
by (auto simp:has_desc_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
421 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
422 |
hence "is_fthread \<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
423 |
by (simp add: desc_is_fthread) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
424 |
with range have fths: "is_fthread \<theta> p i j" "is_fthread \<theta> p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
425 |
unfolding is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
426 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
427 |
hence hfths: "has_fth p i j m (\<theta> j)" "has_fth p j k (\<theta> j) r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
428 |
by (auto simp:has_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
429 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
430 |
from desc obtain l |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
431 |
where "i \<le> l" "l < k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
432 |
and "descat p \<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
433 |
by (auto simp:is_desc_fthread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
434 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
435 |
with fths |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
436 |
have "is_desc_fthread \<theta> p i j \<or> is_desc_fthread \<theta> p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
437 |
unfolding is_desc_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
438 |
by (cases "l < j") auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
439 |
hence "has_desc_fth p i j m (\<theta> j) \<or> has_desc_fth p j k (\<theta> j) r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
440 |
by (auto simp:has_desc_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
441 |
with hfths show ?R |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
442 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
443 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
444 |
assume "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
445 |
then obtain n \<theta>1 \<theta>2 |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
446 |
where "(is_desc_fthread \<theta>1 p i j \<and> is_fthread \<theta>2 p j k) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
447 |
\<or> (is_fthread \<theta>1 p i j \<and> is_desc_fthread \<theta>2 p j k)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
448 |
and [simp]: "\<theta>1 i = m" "\<theta>1 j = n" "\<theta>2 j = n" "\<theta>2 k = r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
449 |
by (auto simp:has_fth_def has_desc_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
450 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
451 |
hence ths2: "is_fthread \<theta>1 p i j" "is_fthread \<theta>2 p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
452 |
and dths: "is_desc_fthread \<theta>1 p i j \<or> is_desc_fthread \<theta>2 p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
453 |
by (auto simp:desc_is_fthread) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
454 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
455 |
let ?\<theta> = "(\<lambda>i. if i < j then \<theta>1 i else \<theta>2 i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
456 |
have "is_fthread ?\<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
457 |
unfolding is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
458 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
459 |
fix l assume range: "l \<in> {i..<k}" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
460 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
461 |
show "eqlat p ?\<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
462 |
proof (cases rule:three_cases) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
463 |
assume "Suc l < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
464 |
with ths2 range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
465 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
466 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
467 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
468 |
assume "Suc l = j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
469 |
hence "l < j" "\<theta>2 (Suc l) = \<theta>1 (Suc l)" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
470 |
with ths2 range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
471 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
472 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
473 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
474 |
assume "j \<le> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
475 |
with ths2 range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
476 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
477 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
478 |
qed arith |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
479 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
480 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
481 |
from dths |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
482 |
have "\<exists>l. i \<le> l \<and> l < k \<and> descat p ?\<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
483 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
484 |
assume "is_desc_fthread \<theta>1 p i j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
485 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
486 |
then obtain l where range: "i \<le> l" "l < j" and "descat p \<theta>1 l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
487 |
unfolding is_desc_fthread_def Bex_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
488 |
hence "descat p ?\<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
489 |
by (cases "Suc l = j", auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
490 |
with `j \<le> k` and range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
491 |
by (rule_tac x="l" in exI, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
492 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
493 |
assume "is_desc_fthread \<theta>2 p j k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
494 |
then obtain l where range: "j \<le> l" "l < k" and "descat p \<theta>2 l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
495 |
unfolding is_desc_fthread_def Bex_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
496 |
with `i < j` have "descat p ?\<theta> l" "i \<le> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
497 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
498 |
with range show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
499 |
by (rule_tac x="l" in exI, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
500 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
501 |
ultimately have "is_desc_fthread ?\<theta> p i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
502 |
by (simp add: is_desc_fthread_def Bex_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
503 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
504 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
505 |
have "?\<theta> i = m" "?\<theta> k = r" using range by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
506 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
507 |
ultimately show "has_desc_fth p i k m r" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
508 |
by (auto simp:has_desc_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
509 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
510 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
511 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
512 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
513 |
lemma fth_single: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
514 |
"has_fth p i (Suc i) m n = eql (snd (p i)) m n" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
515 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
516 |
assume "?L" thus "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
517 |
unfolding is_fthread_def Ball_def has_fth_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
518 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
519 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
520 |
let ?\<theta> = "\<lambda>k. if k = i then m else n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
521 |
assume edge: "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
522 |
hence "is_fthread ?\<theta> p i (Suc i) \<and> ?\<theta> i = m \<and> ?\<theta> (Suc i) = n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
523 |
unfolding is_fthread_def Ball_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
524 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
525 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
526 |
thus "?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
527 |
unfolding has_fth_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
528 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
529 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
530 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
531 |
lemma desc_fth_single: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
532 |
"has_desc_fth p i (Suc i) m n = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
533 |
dsc (snd (p i)) m n" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
534 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
535 |
assume "?L" thus "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
536 |
unfolding is_desc_fthread_def has_desc_fth_def is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
537 |
Bex_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
538 |
by (elim exE conjE) (case_tac "k = i", auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
539 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
540 |
let ?\<theta> = "\<lambda>k. if k = i then m else n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
541 |
assume edge: "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
542 |
hence "is_desc_fthread ?\<theta> p i (Suc i) \<and> ?\<theta> i = m \<and> ?\<theta> (Suc i) = n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
543 |
unfolding is_desc_fthread_def is_fthread_def Ball_def Bex_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
544 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
545 |
thus "?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
546 |
unfolding has_desc_fth_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
547 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
548 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
549 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
550 |
lemma mk_eql: "(G \<turnstile> m \<leadsto>\<^bsup>e\<^esup> n) \<Longrightarrow> eql G m n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
551 |
by (cases e, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
552 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
553 |
lemma eql_scgcomp: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
554 |
"eql (G * H) m r = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
555 |
(\<exists>n. eql G m n \<and> eql H n r)" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
556 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
557 |
show "?L \<Longrightarrow> ?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
558 |
by (auto simp:in_grcomp intro!:mk_eql) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
559 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
560 |
assume "?R" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
561 |
then obtain n where l: "eql G m n" and r:"eql H n r" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
562 |
thus ?L |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
563 |
by (cases "dsc G m n") (auto simp:in_grcomp mult_sedge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
564 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
565 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
566 |
lemma desc_scgcomp: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
567 |
"dsc (G * H) m r = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
568 |
(\<exists>n. (dsc G m n \<and> eql H n r) \<or> (eq G m n \<and> dsc H n r))" (is "?L = ?R") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
569 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
570 |
show "?R \<Longrightarrow> ?L" by (auto simp:in_grcomp mult_sedge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
571 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
572 |
assume "?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
573 |
thus ?R |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
574 |
by (auto simp:in_grcomp mult_sedge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
575 |
(case_tac "e", auto, case_tac "e'", auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
576 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
577 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
578 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
579 |
lemma has_fth_unfold: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
580 |
assumes "i < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
581 |
shows "has_fth p i j m n = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
582 |
(\<exists>r. has_fth p i (Suc i) m r \<and> has_fth p (Suc i) j r n)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
583 |
by (rule combine_fthreads) (insert `i < j`, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
584 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
585 |
lemma has_dfth_unfold: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
586 |
assumes range: "i < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
587 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
588 |
"has_desc_fth p i j m r = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
589 |
(\<exists>n. (has_desc_fth p i (Suc i) m n \<and> has_fth p (Suc i) j n r) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
590 |
\<or> (has_fth p i (Suc i) m n \<and> has_desc_fth p (Suc i) j n r))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
591 |
by (rule combine_dfthreads) (insert `i < j`, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
592 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
593 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
594 |
lemma Lemma7a: |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
595 |
"i \<le> j \<Longrightarrow> has_fth p i j m n = eql (prod (p\<langle>i,j\<rangle>)) m n" |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
596 |
proof (induct i arbitrary: m rule:inc_induct) |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
597 |
case base show ?case |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
598 |
unfolding has_fth_def is_fthread_def sub_path_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
599 |
by (auto simp:in_grunit one_sedge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
600 |
next |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
601 |
case (step i) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
602 |
note IH = `\<And>m. has_fth p (Suc i) j m n = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
603 |
eql (prod (p\<langle>Suc i,j\<rangle>)) m n` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
604 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
605 |
have "has_fth p i j m n |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
606 |
= (\<exists>r. has_fth p i (Suc i) m r \<and> has_fth p (Suc i) j r n)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
607 |
by (rule has_fth_unfold[OF `i < j`]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
608 |
also have "\<dots> = (\<exists>r. has_fth p i (Suc i) m r |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
609 |
\<and> eql (prod (p\<langle>Suc i,j\<rangle>)) r n)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
610 |
by (simp only:IH) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
611 |
also have "\<dots> = (\<exists>r. eql (snd (p i)) m r |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
612 |
\<and> eql (prod (p\<langle>Suc i,j\<rangle>)) r n)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
613 |
by (simp only:fth_single) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
614 |
also have "\<dots> = eql (snd (p i) * prod (p\<langle>Suc i,j\<rangle>)) m n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
615 |
by (simp only:eql_scgcomp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
616 |
also have "\<dots> = eql (prod (p\<langle>i,j\<rangle>)) m n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
617 |
by (simp only:prod_unfold[OF `i < j`]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
618 |
finally show ?case . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
619 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
620 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
621 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
622 |
lemma Lemma7b: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
623 |
assumes "i \<le> j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
624 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
625 |
"has_desc_fth p i j m n = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
626 |
dsc (prod (p\<langle>i,j\<rangle>)) m n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
627 |
using prems |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
628 |
proof (induct i arbitrary: m rule:inc_induct) |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
629 |
case base show ?case |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
630 |
unfolding has_desc_fth_def is_desc_fthread_def sub_path_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
631 |
by (auto simp:in_grunit one_sedge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
632 |
next |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
633 |
case (step i) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
634 |
thus ?case |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
635 |
by (simp only:prod_unfold desc_scgcomp desc_fth_single |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
636 |
has_dfth_unfold fth_single Lemma7a) auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
637 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
638 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
639 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
640 |
lemma descat_contract: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
641 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
642 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
643 |
"descat (contract s p) \<theta> i = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
644 |
has_desc_fth p (s i) (s (Suc i)) (\<theta> i) (\<theta> (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
645 |
by (simp add:Lemma7b increasing_weak contract_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
646 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
647 |
lemma eqlat_contract: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
648 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
649 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
650 |
"eqlat (contract s p) \<theta> i = |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
651 |
has_fth p (s i) (s (Suc i)) (\<theta> i) (\<theta> (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
652 |
by (auto simp:Lemma7a increasing_weak contract_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
653 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
654 |
|
22665 | 655 |
subsubsection {* Connecting threads *} |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
656 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
657 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
658 |
"connect s \<theta>s = (\<lambda>k. \<theta>s (section_of s k) k)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
659 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
660 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
661 |
lemma next_in_range: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
662 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
663 |
assumes a: "k \<in> section s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
664 |
shows "(Suc k \<in> section s i) \<or> (Suc k \<in> section s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
665 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
666 |
from a have "k < s (Suc i)" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
667 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
668 |
hence "Suc k < s (Suc i) \<or> Suc k = s (Suc i)" by arith |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
669 |
thus ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
670 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
671 |
assume "Suc k < s (Suc i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
672 |
with a have "Suc k \<in> section s i" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
673 |
thus ?thesis .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
674 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
675 |
assume eq: "Suc k = s (Suc i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
676 |
with increasing_strict have "Suc k < s (Suc (Suc i))" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
677 |
with eq have "Suc k \<in> section s (Suc i)" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
678 |
thus ?thesis .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
679 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
680 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
681 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
682 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
683 |
lemma connect_threads: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
684 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
685 |
assumes connected: "\<theta>s i (s (Suc i)) = \<theta>s (Suc i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
686 |
assumes fth: "is_fthread (\<theta>s i) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
687 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
688 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
689 |
"is_fthread (connect s \<theta>s) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
690 |
unfolding is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
691 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
692 |
fix k assume krng: "k \<in> section s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
693 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
694 |
with fth have eqlat: "eqlat p (\<theta>s i) k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
695 |
unfolding is_fthread_def by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
696 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
697 |
from krng and next_in_range |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
698 |
have "(Suc k \<in> section s i) \<or> (Suc k \<in> section s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
699 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
700 |
thus "eqlat p (connect s \<theta>s) k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
701 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
702 |
assume "Suc k \<in> section s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
703 |
with krng eqlat show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
704 |
unfolding connect_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
705 |
by (simp only:section_of_known `increasing s`) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
706 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
707 |
assume skrng: "Suc k \<in> section s (Suc i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
708 |
with krng have "Suc k = s (Suc i)" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
709 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
710 |
with krng skrng eqlat show ?thesis |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
711 |
unfolding connect_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
712 |
by (simp only:section_of_known connected[symmetric] `increasing s`) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
713 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
714 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
715 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
716 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
717 |
lemma connect_dthreads: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
718 |
assumes inc[simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
719 |
assumes connected: "\<theta>s i (s (Suc i)) = \<theta>s (Suc i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
720 |
assumes fth: "is_desc_fthread (\<theta>s i) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
721 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
722 |
shows |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
723 |
"is_desc_fthread (connect s \<theta>s) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
724 |
unfolding is_desc_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
725 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
726 |
show "is_fthread (connect s \<theta>s) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
727 |
apply (rule connect_threads) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
728 |
apply (insert fth) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
729 |
by (auto simp:connected is_desc_fthread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
730 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
731 |
from fth |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
732 |
obtain k where dsc: "descat p (\<theta>s i) k" and krng: "k \<in> section s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
733 |
unfolding is_desc_fthread_def by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
734 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
735 |
from krng and next_in_range |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
736 |
have "(Suc k \<in> section s i) \<or> (Suc k \<in> section s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
737 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
738 |
hence "descat p (connect s \<theta>s) k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
739 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
740 |
assume "Suc k \<in> section s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
741 |
with krng dsc show ?thesis unfolding connect_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
742 |
by (simp only:section_of_known inc) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
743 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
744 |
assume skrng: "Suc k \<in> section s (Suc i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
745 |
with krng have "Suc k = s (Suc i)" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
746 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
747 |
with krng skrng dsc show ?thesis unfolding connect_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
748 |
by (simp only:section_of_known connected[symmetric] inc) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
749 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
750 |
with krng show "\<exists>k\<in>section s i. descat p (connect s \<theta>s) k" .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
751 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
752 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
753 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
754 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
755 |
lemma mk_inf_thread: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
756 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
757 |
assumes fths: "\<And>i. i > n \<Longrightarrow> is_fthread \<theta> p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
758 |
shows "is_thread (s (Suc n)) \<theta> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
759 |
unfolding is_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
760 |
proof (intro allI impI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
761 |
fix j assume st: "s (Suc n) \<le> j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
762 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
763 |
let ?k = "section_of s j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
764 |
from in_section_of st |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
765 |
have rs: "j \<in> section s ?k" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
766 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
767 |
with st have "s (Suc n) < s (Suc ?k)" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
768 |
with increasing_bij have "n < ?k" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
769 |
with rs and fths[of ?k] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
770 |
show "eqlat p \<theta> j" by (simp add:is_fthread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
771 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
772 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
773 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
774 |
lemma mk_inf_desc_thread: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
775 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
776 |
assumes fths: "\<And>i. i > n \<Longrightarrow> is_fthread \<theta> p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
777 |
assumes fdths: "\<exists>\<^sub>\<infinity>i. is_desc_fthread \<theta> p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
778 |
shows "is_desc_thread \<theta> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
779 |
unfolding is_desc_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
780 |
proof (intro exI conjI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
781 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
782 |
from mk_inf_thread[of s n] is_thread_def fths |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
783 |
show "\<forall>i\<ge>s (Suc n). eqlat p \<theta> i" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
784 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
785 |
show "\<exists>\<^sub>\<infinity>l. descat p \<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
786 |
unfolding INF_nat |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
787 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
788 |
fix i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
789 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
790 |
let ?k = "section_of s i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
791 |
from fdths obtain j |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
792 |
where "?k < j" "is_desc_fthread \<theta> p (s j) (s (Suc j))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
793 |
unfolding INF_nat by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
794 |
then obtain l where "s j \<le> l" and desc: "descat p \<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
795 |
unfolding is_desc_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
796 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
797 |
|
23373 | 798 |
have "i < s (Suc ?k)" by (rule section_of2) simp |
799 |
also have "\<dots> \<le> s j" |
|
23394 | 800 |
by (rule increasing_weak [OF `increasing s`]) (insert `?k < j`, arith) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
801 |
also note `\<dots> \<le> l` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
802 |
finally have "i < l" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
803 |
with desc |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
804 |
show "\<exists>l. i < l \<and> descat p \<theta> l" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
805 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
806 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
807 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
808 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
809 |
lemma desc_ex_choice: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
810 |
assumes A: "((\<exists>n.\<forall>i\<ge>n. \<exists>x. P x i) \<and> (\<exists>\<^sub>\<infinity>i. \<exists>x. Q x i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
811 |
and imp: "\<And>x i. Q x i \<Longrightarrow> P x i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
812 |
shows "\<exists>xs. ((\<exists>n.\<forall>i\<ge>n. P (xs i) i) \<and> (\<exists>\<^sub>\<infinity>i. Q (xs i) i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
813 |
(is "\<exists>xs. ?Ps xs \<and> ?Qs xs") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
814 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
815 |
let ?w = "\<lambda>i. (if (\<exists>x. Q x i) then (SOME x. Q x i) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
816 |
else (SOME x. P x i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
817 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
818 |
from A |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
819 |
obtain n where P: "\<And>i. n \<le> i \<Longrightarrow> \<exists>x. P x i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
820 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
821 |
{ |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
822 |
fix i::'a assume "n \<le> i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
823 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
824 |
have "P (?w i) i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
825 |
proof (cases "\<exists>x. Q x i") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
826 |
case True |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
827 |
hence "Q (?w i) i" by (auto intro:someI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
828 |
with imp show "P (?w i) i" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
829 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
830 |
case False |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
831 |
with P[OF `n \<le> i`] show "P (?w i) i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
832 |
by (auto intro:someI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
833 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
834 |
} |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
835 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
836 |
hence "?Ps ?w" by (rule_tac x=n in exI) auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
837 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
838 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
839 |
from A have "\<exists>\<^sub>\<infinity>i. (\<exists>x. Q x i)" .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
840 |
hence "?Qs ?w" by (rule INF_mono) (auto intro:someI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
841 |
ultimately |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
842 |
show "?Ps ?w \<and> ?Qs ?w" .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
843 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
844 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
845 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
846 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
847 |
lemma dthreads_join: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
848 |
assumes [simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
849 |
assumes dthread: "is_desc_thread \<theta> (contract s p)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
850 |
shows "\<exists>\<theta>s. desc (\<lambda>i. is_fthread (\<theta>s i) p (s i) (s (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
851 |
\<and> \<theta>s i (s i) = \<theta> i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
852 |
\<and> \<theta>s i (s (Suc i)) = \<theta> (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
853 |
(\<lambda>i. is_desc_fthread (\<theta>s i) p (s i) (s (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
854 |
\<and> \<theta>s i (s i) = \<theta> i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
855 |
\<and> \<theta>s i (s (Suc i)) = \<theta> (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
856 |
apply (rule desc_ex_choice) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
857 |
apply (insert dthread) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
858 |
apply (simp only:is_desc_thread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
859 |
apply (simp add:eqlat_contract) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
860 |
apply (simp add:descat_contract) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
861 |
apply (simp only:has_fth_def has_desc_fth_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
862 |
by (auto simp:is_desc_fthread_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
863 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
864 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
865 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
866 |
lemma INF_drop_prefix: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
867 |
"(\<exists>\<^sub>\<infinity>i::nat. i > n \<and> P i) = (\<exists>\<^sub>\<infinity>i. P i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
868 |
apply (auto simp:INF_nat) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
869 |
apply (drule_tac x = "max m n" in spec) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
870 |
apply (elim exE conjE) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
871 |
apply (rule_tac x = "na" in exI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
872 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
873 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
874 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
875 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
876 |
lemma contract_keeps_threads: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
877 |
assumes inc[simp]: "increasing s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
878 |
shows "(\<exists>\<theta>. is_desc_thread \<theta> p) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
879 |
\<longleftrightarrow> (\<exists>\<theta>. is_desc_thread \<theta> (contract s p))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
880 |
(is "?A \<longleftrightarrow> ?B") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
881 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
882 |
assume "?A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
883 |
then obtain \<theta> n |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
884 |
where fr: "\<forall>i\<ge>n. eqlat p \<theta> i" |
22665 | 885 |
and ds: "\<exists>\<^sub>\<infinity>i. descat p \<theta> i" |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
886 |
unfolding is_desc_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
887 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
888 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
889 |
let ?c\<theta> = "\<lambda>i. \<theta> (s i)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
890 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
891 |
have "is_desc_thread ?c\<theta> (contract s p)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
892 |
unfolding is_desc_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
893 |
proof (intro exI conjI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
894 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
895 |
show "\<forall>i\<ge>n. eqlat (contract s p) ?c\<theta> i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
896 |
proof (intro allI impI) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
897 |
fix i assume "n \<le> i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
898 |
also have "i \<le> s i" |
22665 | 899 |
using increasing_inc by auto |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
900 |
finally have "n \<le> s i" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
901 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
902 |
with fr have "is_fthread \<theta> p (s i) (s (Suc i))" |
22665 | 903 |
unfolding is_fthread_def by auto |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
904 |
hence "has_fth p (s i) (s (Suc i)) (\<theta> (s i)) (\<theta> (s (Suc i)))" |
22665 | 905 |
unfolding has_fth_def by auto |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
906 |
with less_imp_le[OF increasing_strict] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
907 |
have "eql (prod (p\<langle>s i,s (Suc i)\<rangle>)) (\<theta> (s i)) (\<theta> (s (Suc i)))" |
22665 | 908 |
by (simp add:Lemma7a) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
909 |
thus "eqlat (contract s p) ?c\<theta> i" unfolding contract_def |
22665 | 910 |
by auto |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
911 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
912 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
913 |
show "\<exists>\<^sub>\<infinity>i. descat (contract s p) ?c\<theta> i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
914 |
unfolding INF_nat |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
915 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
916 |
fix i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
917 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
918 |
let ?K = "section_of s (max (s (Suc i)) n)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
919 |
from `\<exists>\<^sub>\<infinity>i. descat p \<theta> i` obtain j |
22665 | 920 |
where "s (Suc ?K) < j" "descat p \<theta> j" |
921 |
unfolding INF_nat by blast |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
922 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
923 |
let ?L = "section_of s j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
924 |
{ |
22665 | 925 |
fix x assume r: "x \<in> section s ?L" |
926 |
||
23373 | 927 |
have e1: "max (s (Suc i)) n < s (Suc ?K)" by (rule section_of2) simp |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
928 |
note `s (Suc ?K) < j` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
929 |
also have "j < s (Suc ?L)" |
23373 | 930 |
by (rule section_of2) simp |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
931 |
finally have "Suc ?K \<le> ?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
932 |
by (simp add:increasing_bij) |
22665 | 933 |
with increasing_weak have "s (Suc ?K) \<le> s ?L" by simp |
934 |
with e1 r have "max (s (Suc i)) n < x" by simp |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
935 |
|
22665 | 936 |
hence "(s (Suc i)) < x" "n < x" by auto |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
937 |
} |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
938 |
note range_est = this |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
939 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
940 |
have "is_desc_fthread \<theta> p (s ?L) (s (Suc ?L))" |
22665 | 941 |
unfolding is_desc_fthread_def is_fthread_def |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
942 |
proof |
22665 | 943 |
show "\<forall>m\<in>section s ?L. eqlat p \<theta> m" |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
944 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
945 |
fix m assume "m\<in>section s ?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
946 |
with range_est(2) have "n < m" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
947 |
with fr show "eqlat p \<theta> m" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
948 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
949 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
950 |
from in_section_of inc less_imp_le[OF `s (Suc ?K) < j`] |
22665 | 951 |
have "j \<in> section s ?L" . |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
952 |
|
22665 | 953 |
with `descat p \<theta> j` |
954 |
show "\<exists>m\<in>section s ?L. descat p \<theta> m" .. |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
955 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
956 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
957 |
with less_imp_le[OF increasing_strict] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
958 |
have a: "descat (contract s p) ?c\<theta> ?L" |
22665 | 959 |
unfolding contract_def Lemma7b[symmetric] |
960 |
by (auto simp:Lemma7b[symmetric] has_desc_fth_def) |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
961 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
962 |
have "i < ?L" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
963 |
proof (rule classical) |
22665 | 964 |
assume "\<not> i < ?L" |
965 |
hence "s ?L < s (Suc i)" |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
966 |
by (simp add:increasing_bij) |
22665 | 967 |
also have "\<dots> < s ?L" |
968 |
by (rule range_est(1)) (simp add:increasing_strict) |
|
969 |
finally show ?thesis . |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
970 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
971 |
with a show "\<exists>l. i < l \<and> descat (contract s p) ?c\<theta> l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
972 |
by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
973 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
974 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
975 |
with exI show "?B" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
976 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
977 |
assume "?B" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
978 |
then obtain \<theta> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
979 |
where dthread: "is_desc_thread \<theta> (contract s p)" .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
980 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
981 |
with dthreads_join inc |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
982 |
obtain \<theta>s where ths_spec: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
983 |
"desc (\<lambda>i. is_fthread (\<theta>s i) p (s i) (s (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
984 |
\<and> \<theta>s i (s i) = \<theta> i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
985 |
\<and> \<theta>s i (s (Suc i)) = \<theta> (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
986 |
(\<lambda>i. is_desc_fthread (\<theta>s i) p (s i) (s (Suc i)) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
987 |
\<and> \<theta>s i (s i) = \<theta> i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
988 |
\<and> \<theta>s i (s (Suc i)) = \<theta> (Suc i))" |
22665 | 989 |
(is "desc ?alw ?inf") |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
990 |
by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
991 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
992 |
then obtain n where fr: "\<forall>i\<ge>n. ?alw i" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
993 |
hence connected: "\<And>i. n < i \<Longrightarrow> \<theta>s i (s (Suc i)) = \<theta>s (Suc i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
994 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
995 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
996 |
let ?j\<theta> = "connect s \<theta>s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
997 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
998 |
from fr ths_spec have ths_spec2: |
22665 | 999 |
"\<And>i. i > n \<Longrightarrow> is_fthread (\<theta>s i) p (s i) (s (Suc i))" |
1000 |
"\<exists>\<^sub>\<infinity>i. is_desc_fthread (\<theta>s i) p (s i) (s (Suc i))" |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1001 |
by (auto intro:INF_mono) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1002 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1003 |
have p1: "\<And>i. i > n \<Longrightarrow> is_fthread ?j\<theta> p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1004 |
by (rule connect_threads) (auto simp:connected ths_spec2) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1005 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1006 |
from ths_spec2(2) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1007 |
have "\<exists>\<^sub>\<infinity>i. n < i \<and> is_desc_fthread (\<theta>s i) p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1008 |
unfolding INF_drop_prefix . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1009 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1010 |
hence p2: "\<exists>\<^sub>\<infinity>i. is_desc_fthread ?j\<theta> p (s i) (s (Suc i))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1011 |
apply (rule INF_mono) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1012 |
apply (rule connect_dthreads) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1013 |
by (auto simp:connected) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1014 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1015 |
with `increasing s` p1 |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1016 |
have "is_desc_thread ?j\<theta> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1017 |
by (rule mk_inf_desc_thread) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1018 |
with exI show "?A" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1019 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1020 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1021 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1022 |
lemma repeated_edge: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1023 |
assumes "\<And>i. i > n \<Longrightarrow> dsc (snd (p i)) k k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1024 |
shows "is_desc_thread (\<lambda>i. k) p" |
23315 | 1025 |
proof- |
1026 |
have th: "\<forall> m. \<exists>na>m. n < na" by arith |
|
1027 |
show ?thesis using prems |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1028 |
unfolding is_desc_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1029 |
apply (auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1030 |
apply (rule_tac x="Suc n" in exI, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1031 |
apply (rule INF_mono[where P="\<lambda>i. n < i"]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1032 |
apply (simp only:INF_nat) |
23315 | 1033 |
by (auto simp add: th) |
1034 |
qed |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1035 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1036 |
lemma fin_from_inf: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1037 |
assumes "is_thread n \<theta> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1038 |
assumes "n < i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1039 |
assumes "i < j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1040 |
shows "is_fthread \<theta> p i j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1041 |
using prems |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1042 |
unfolding is_thread_def is_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1043 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1044 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1045 |
|
22665 | 1046 |
subsection {* Ramsey's Theorem *} |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1047 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1048 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1049 |
"set2pair S = (THE (x,y). x < y \<and> S = {x,y})" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1050 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1051 |
lemma set2pair_conv: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1052 |
fixes x y :: nat |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1053 |
assumes "x < y" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1054 |
shows "set2pair {x, y} = (x, y)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1055 |
unfolding set2pair_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1056 |
proof (rule the_equality, simp_all only:split_conv split_paired_all) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1057 |
from `x < y` show "x < y \<and> {x,y}={x,y}" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1058 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1059 |
fix a b |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1060 |
assume a: "a < b \<and> {x, y} = {a, b}" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1061 |
hence "{a, b} = {x, y}" by simp_all |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1062 |
hence "(a, b) = (x, y) \<or> (a, b) = (y, x)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1063 |
by (cases "x = y") auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1064 |
thus "(a, b) = (x, y)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1065 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1066 |
assume "(a, b) = (y, x)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1067 |
with a and `x < y` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1068 |
show ?thesis by auto (* contradiction *) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1069 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1070 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1071 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1072 |
definition |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1073 |
"set2list = inv set" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1074 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1075 |
lemma finite_set2list: |
23373 | 1076 |
assumes "finite S" |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1077 |
shows "set (set2list S) = S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1078 |
unfolding set2list_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1079 |
proof (rule f_inv_f) |
23373 | 1080 |
from `finite S` have "\<exists>l. set l = S" |
1081 |
by (rule finite_list) |
|
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1082 |
thus "S \<in> range set" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1083 |
unfolding image_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1084 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1085 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1086 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1087 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1088 |
corollary RamseyNatpairs: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1089 |
fixes S :: "'a set" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1090 |
and f :: "nat \<times> nat \<Rightarrow> 'a" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1091 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1092 |
assumes "finite S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1093 |
and inS: "\<And>x y. x < y \<Longrightarrow> f (x, y) \<in> S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1094 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1095 |
obtains T :: "nat set" and s :: "'a" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1096 |
where "infinite T" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1097 |
and "s \<in> S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1098 |
and "\<And>x y. \<lbrakk>x \<in> T; y \<in> T; x < y\<rbrakk> \<Longrightarrow> f (x, y) = s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1099 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1100 |
from `finite S` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1101 |
have "set (set2list S) = S" by (rule finite_set2list) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1102 |
then |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1103 |
obtain l where S: "S = set l" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1104 |
also from set_conv_nth have "\<dots> = {l ! i |i. i < length l}" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1105 |
finally have "S = {l ! i |i. i < length l}" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1106 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1107 |
let ?s = "length l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1108 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1109 |
from inS |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1110 |
have index_less: "\<And>x y. x \<noteq> y \<Longrightarrow> index_of l (f (set2pair {x, y})) < ?s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1111 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1112 |
fix x y :: nat |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1113 |
assume neq: "x \<noteq> y" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1114 |
have "f (set2pair {x, y}) \<in> S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1115 |
proof (cases "x < y") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1116 |
case True hence "set2pair {x, y} = (x, y)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1117 |
by (rule set2pair_conv) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1118 |
with True inS |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1119 |
show ?thesis by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1120 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1121 |
case False |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1122 |
with neq have y_less: "y < x" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1123 |
have x:"{x,y} = {y,x}" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1124 |
with y_less have "set2pair {x, y} = (y, x)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1125 |
by (simp add:set2pair_conv) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1126 |
with y_less inS |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1127 |
show ?thesis by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1128 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1129 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1130 |
thus "index_of l (f (set2pair {x, y})) < length l" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1131 |
by (simp add: S index_of_length) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1132 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1133 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1134 |
have "\<exists>Y. infinite Y \<and> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1135 |
(\<exists>t. t < ?s \<and> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1136 |
(\<forall>x\<in>Y. \<forall>y\<in>Y. x \<noteq> y \<longrightarrow> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1137 |
index_of l (f (set2pair {x, y})) = t))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1138 |
by (rule Ramsey2[of "UNIV::nat set", simplified]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1139 |
(auto simp:index_less) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1140 |
then obtain T i |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1141 |
where inf: "infinite T" |
23389 | 1142 |
and i: "i < length l" |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1143 |
and d: "\<And>x y. \<lbrakk>x \<in> T; y\<in>T; x \<noteq> y\<rbrakk> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1144 |
\<Longrightarrow> index_of l (f (set2pair {x, y})) = i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1145 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1146 |
|
23389 | 1147 |
have "l ! i \<in> S" unfolding S using i |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1148 |
by (rule nth_mem) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1149 |
moreover |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1150 |
have "\<And>x y. x \<in> T \<Longrightarrow> y\<in>T \<Longrightarrow> x < y |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1151 |
\<Longrightarrow> f (x, y) = l ! i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1152 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1153 |
fix x y assume "x \<in> T" "y \<in> T" "x < y" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1154 |
with d have |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1155 |
"index_of l (f (set2pair {x, y})) = i" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1156 |
with `x < y` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1157 |
have "i = index_of l (f (x, y))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1158 |
by (simp add:set2pair_conv) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1159 |
with `i < length l` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1160 |
show "f (x, y) = l ! i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1161 |
by (auto intro:index_of_member[symmetric] iff:index_of_length) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1162 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1163 |
moreover note inf |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1164 |
ultimately |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1165 |
show ?thesis using prems |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1166 |
by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1167 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1168 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1169 |
|
22665 | 1170 |
subsection {* Main Result *} |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1171 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1172 |
theorem LJA_Theorem4: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1173 |
assumes "bounded_acg P \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1174 |
shows "SCT \<A> \<longleftrightarrow> SCT' \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1175 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1176 |
assume "SCT \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1177 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1178 |
show "SCT' \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1179 |
proof (rule classical) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1180 |
assume "\<not> SCT' \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1181 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1182 |
then obtain n G |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1183 |
where in_closure: "(tcl \<A>) \<turnstile> n \<leadsto>\<^bsup>G\<^esup> n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1184 |
and idemp: "G * G = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1185 |
and no_strict_arc: "\<forall>p. \<not>(G \<turnstile> p \<leadsto>\<^bsup>\<down>\<^esup> p)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1186 |
unfolding SCT'_def no_bad_graphs_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1187 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1188 |
from in_closure obtain k |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1189 |
where k_pow: "\<A> ^ k \<turnstile> n \<leadsto>\<^bsup>G\<^esup> n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1190 |
and "0 < k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1191 |
unfolding in_tcl by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1192 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1193 |
from power_induces_path k_pow |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1194 |
obtain loop where loop_props: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1195 |
"has_fpath \<A> loop" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1196 |
"n = fst loop" "n = end_node loop" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1197 |
"G = prod loop" "k = length (snd loop)" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1198 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1199 |
with `0 < k` and path_loop_graph |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1200 |
have "has_ipath \<A> (omega loop)" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1201 |
with `SCT \<A>` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1202 |
have thread: "\<exists>\<theta>. is_desc_thread \<theta> (omega loop)" by (auto simp:SCT_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1203 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1204 |
let ?s = "\<lambda>i. k * i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1205 |
let ?cp = "\<lambda>i. (n, G)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1206 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1207 |
from loop_props have "fst loop = end_node loop" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1208 |
with `0 < k` `k = length (snd loop)` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1209 |
have "\<And>i. (omega loop)\<langle>?s i,?s (Suc i)\<rangle> = loop" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1210 |
by (rule sub_path_loop) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1211 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1212 |
with `n = fst loop` `G = prod loop` `k = length (snd loop)` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1213 |
have a: "contract ?s (omega loop) = ?cp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1214 |
unfolding contract_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1215 |
by (simp add:path_loop_def split_def fst_p0) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1216 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1217 |
from `0 < k` have "increasing ?s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1218 |
by (auto simp:increasing_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1219 |
with thread have "\<exists>\<theta>. is_desc_thread \<theta> ?cp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1220 |
unfolding a[symmetric] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1221 |
by (unfold contract_keeps_threads[symmetric]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1222 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1223 |
then obtain \<theta> where desc: "is_desc_thread \<theta> ?cp" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1224 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1225 |
then obtain n where thr: "is_thread n \<theta> ?cp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1226 |
unfolding is_desc_thread_def is_thread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1227 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1228 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1229 |
have "bounded_th P n \<theta>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1230 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1231 |
from `bounded_acg P \<A>` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1232 |
have "bounded_acg P (tcl \<A>)" by (rule bounded_plus) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1233 |
with in_closure have "bounded_scg P G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1234 |
unfolding bounded_acg_def by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1235 |
hence "bounded_mp P ?cp" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1236 |
unfolding bounded_mp_def by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1237 |
with thr bounded_th |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1238 |
show ?thesis by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1239 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1240 |
with bounded_th_infinite_visit |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1241 |
obtain p where inf_visit: "\<exists>\<^sub>\<infinity>i. \<theta> i = p" by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1242 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1243 |
then obtain i where "n < i" "\<theta> i = p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1244 |
by (auto simp:INF_nat) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1245 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1246 |
from desc |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1247 |
have "\<exists>\<^sub>\<infinity>i. descat ?cp \<theta> i" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1248 |
unfolding is_desc_thread_def by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1249 |
then obtain j |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1250 |
where "i < j" and "descat ?cp \<theta> j" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1251 |
unfolding INF_nat by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1252 |
from inf_visit obtain k where "j < k" "\<theta> k = p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1253 |
by (auto simp:INF_nat) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1254 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1255 |
from `i < j` `j < k` `n < i` thr fin_from_inf `descat ?cp \<theta> j` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1256 |
have "is_desc_fthread \<theta> ?cp i k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1257 |
unfolding is_desc_fthread_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1258 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1259 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1260 |
with `\<theta> k = p` `\<theta> i = p` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1261 |
have dfth: "has_desc_fth ?cp i k p p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1262 |
unfolding has_desc_fth_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1263 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1264 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1265 |
from `i < j` `j < k` have "i < k" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1266 |
hence "prod (?cp\<langle>i, k\<rangle>) = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1267 |
proof (induct i rule:strict_inc_induct) |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
1268 |
case base thus ?case by (simp add:sub_path_def) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1269 |
next |
23014
00d8bf2fce42
Had to replace "case 1/2" by "case base/step". No idea why.
nipkow
parents:
22665
diff
changeset
|
1270 |
case (step i) thus ?case |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1271 |
by (simp add:sub_path_def upt_rec[of i k] idemp) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1272 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1273 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1274 |
with `i < j` `j < k` dfth Lemma7b |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1275 |
have "dsc G p p" by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1276 |
with no_strict_arc have False by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1277 |
thus ?thesis .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1278 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1279 |
next |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1280 |
assume "SCT' \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1281 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1282 |
show "SCT \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1283 |
proof (rule classical) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1284 |
assume "\<not> SCT \<A>" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1285 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1286 |
with SCT_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1287 |
obtain p |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1288 |
where ipath: "has_ipath \<A> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1289 |
and no_desc_th: "\<not> (\<exists>\<theta>. is_desc_thread \<theta> p)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1290 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1291 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1292 |
from `bounded_acg P \<A>` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1293 |
have "finite (dest_graph (tcl \<A>))" (is "finite ?AG") |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1294 |
by (intro bounded_finite bounded_plus) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1295 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1296 |
from pdesc_acgplus[OF ipath] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1297 |
have a: "\<And>x y. x<y \<Longrightarrow> pdesc p\<langle>x,y\<rangle> \<in> dest_graph (tcl \<A>)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1298 |
unfolding has_edge_def . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1299 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1300 |
obtain S G |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1301 |
where "infinite S" "G \<in> dest_graph (tcl \<A>)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1302 |
and all_G: "\<And>x y. \<lbrakk> x \<in> S; y \<in> S; x < y\<rbrakk> \<Longrightarrow> |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1303 |
pdesc (p\<langle>x,y\<rangle>) = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1304 |
apply (rule RamseyNatpairs[of ?AG "\<lambda>(x,y). pdesc p\<langle>x, y\<rangle>"]) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1305 |
apply (rule `finite (dest_graph (tcl \<A>))`) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1306 |
by (simp only:split_conv, rule a, auto) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1307 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1308 |
obtain n H m where |
23373 | 1309 |
G_struct: "G = (n, H, m)" by (cases G) |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1310 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1311 |
let ?s = "enumerate S" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1312 |
let ?q = "contract ?s p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1313 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1314 |
note all_in_S[simp] = enumerate_in_set[OF `infinite S`] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1315 |
from `infinite S` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1316 |
have inc[simp]: "increasing ?s" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1317 |
unfolding increasing_def by (simp add:enumerate_mono) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1318 |
note increasing_bij[OF this, simp] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1319 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1320 |
from ipath_contract inc ipath |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1321 |
have "has_ipath (tcl \<A>) ?q" . |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1322 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1323 |
from all_G G_struct |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1324 |
have all_H: "\<And>i. (snd (?q i)) = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1325 |
unfolding contract_def |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1326 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1327 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1328 |
have loop: "(tcl \<A>) \<turnstile> n \<leadsto>\<^bsup>H\<^esup> n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1329 |
and idemp: "H * H = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1330 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1331 |
let ?i = "?s 0" and ?j = "?s (Suc 0)" and ?k = "?s (Suc (Suc 0))" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1332 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1333 |
have "pdesc (p\<langle>?i,?j\<rangle>) = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1334 |
and "pdesc (p\<langle>?j,?k\<rangle>) = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1335 |
and "pdesc (p\<langle>?i,?k\<rangle>) = G" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1336 |
using all_G |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1337 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1338 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1339 |
with G_struct |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1340 |
have "m = end_node (p\<langle>?i,?j\<rangle>)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1341 |
"n = fst (p\<langle>?j,?k\<rangle>)" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1342 |
and Hs: "prod (p\<langle>?i,?j\<rangle>) = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1343 |
"prod (p\<langle>?j,?k\<rangle>) = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1344 |
"prod (p\<langle>?i,?k\<rangle>) = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1345 |
by auto |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1346 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1347 |
hence "m = n" by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1348 |
thus "tcl \<A> \<turnstile> n \<leadsto>\<^bsup>H\<^esup> n" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1349 |
using G_struct `G \<in> dest_graph (tcl \<A>)` |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1350 |
by (simp add:has_edge_def) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1351 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1352 |
from sub_path_prod[of ?i ?j ?k p] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1353 |
show "H * H = H" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1354 |
unfolding Hs by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1355 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1356 |
moreover have "\<And>k. \<not>dsc H k k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1357 |
proof |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1358 |
fix k :: nat assume "dsc H k k" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1359 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1360 |
with all_H repeated_edge |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1361 |
have "\<exists>\<theta>. is_desc_thread \<theta> ?q" by fast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1362 |
with inc have "\<exists>\<theta>. is_desc_thread \<theta> p" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1363 |
by (subst contract_keeps_threads) |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1364 |
with no_desc_th |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1365 |
show False .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1366 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1367 |
ultimately |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1368 |
have False |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1369 |
using `SCT' \<A>`[unfolded SCT'_def no_bad_graphs_def] |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1370 |
by blast |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1371 |
thus ?thesis .. |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1372 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1373 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1374 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1375 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1376 |
lemma LJA_apply: |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1377 |
assumes fin: "finite_acg A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1378 |
assumes "SCT' A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1379 |
shows "SCT A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1380 |
proof - |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1381 |
from fin obtain P where b: "bounded_acg P A" |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1382 |
unfolding finite_acg_def .. |
23373 | 1383 |
show ?thesis using LJA_Theorem4[OF b] and `SCT' A` |
22359
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1384 |
by simp |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1385 |
qed |
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1386 |
|
94a794672c8b
Added formalization of size-change principle (experimental).
krauss
parents:
diff
changeset
|
1387 |
end |