text\<open>Reach: the set of reachable nodes is the set of Roots together with the
nodes reachable from some Root by a path represented by a list of
nodes (at least two since we traverse at least one edge), where two
consecutive nodes correspond to an edge in E.\<close>
lemma Ex_first_occurrence [rule_format]: "P (n::nat) \ (\m. P m \ (\i. i \ P i))" apply(rule nat_less_induct) apply clarify apply(case_tac "\m. m \ P m") apply auto done
lemma Graph3: "\ T\Reach E; R \ Reach(E[R:=(fst(E!R),T)]) \ Reach E" apply (unfold Reach_def) apply clarify apply simp apply(case_tac "\i \<comment> \<open>the changed edge is part of the path\<close> apply(erule exE) apply(drule_tac P = "\i. i (fst(E!R),T)=(path!Suc i,path!i)" in Ex_first_occurrence) apply clarify apply(erule disjE) \<comment> \<open>T is NOT a root\<close> apply clarify apply(rule_tac x = "(take m path)@patha"in exI) apply(subgoal_tac "\(length path\m)") prefer 2 apply arith apply(simp) apply(rule conjI) apply(subgoal_tac "\(m + length patha - 1 < m)") prefer 2 apply arith apply(simp add: nth_append) apply(rule conjI) apply(case_tac "m") apply force apply(case_tac "path") apply force apply force apply clarify apply(case_tac "Suc i\m") apply(erule_tac x = "i"in allE) apply simp apply clarify apply(rule_tac x = "j"in exI) apply(case_tac "Suc i) apply(simp add: nth_append) apply(case_tac "R=j") apply(simp add: nth_list_update) apply(case_tac "i=m") apply force apply(erule_tac x = "i"in allE) apply force apply(force simp add: nth_list_update) apply(simp add: nth_append) apply(subgoal_tac "i=m - 1") prefer 2 apply arith apply(case_tac "R=j") apply(erule_tac x = "m - 1"in allE) apply(simp add: nth_list_update) apply(force simp add: nth_list_update) apply(simp add: nth_append) apply(rotate_tac -4) apply(erule_tac x = "i - m"in allE) apply(subgoal_tac "Suc (i - m)=(Suc i - m)" ) prefer 2 apply arith apply simp \<comment> \<open>T is a root\<close> apply(case_tac "m=0") apply force apply(rule_tac x = "take (Suc m) path"in exI) apply(subgoal_tac "\(length path\Suc m)" ) prefer 2 apply arith apply clarsimp apply(erule_tac x = "i"in allE) apply simp apply clarify apply(case_tac "R=j") apply(force simp add: nth_list_update) apply(force simp add: nth_list_update) \<comment> \<open>the changed edge is not part of the path\<close> apply(rule_tac x = "path"in exI) apply simp apply clarify apply(erule_tac x = "i"in allE) apply clarify apply(case_tac "R=j") apply(erule_tac x = "i"in allE) apply simp apply(force simp add: nth_list_update) done
subsubsection\<open>Graph 4\<close>
lemma Graph4: "\T \ Reach E; Roots\Blacks M; I\length E; T \<forall>i<I. \<not>BtoW(E!i,M); R<I; M!fst(E!R)=Black; M!T\<noteq>Black\<rbrakk> \<Longrightarrow>
(\<exists>r. I\<le>r \<and> r<length E \<and> BtoW(E[R:=(fst(E!R),T)]!r,M))" apply (unfold Reach_def) apply simp apply(erule disjE) prefer 2 apply force apply clarify \<comment> \<open>there exist a black node in the path to T\<close> apply(case_tac "\m apply(erule exE) apply(drule_tac P = "\m. m M!(path!m)=Black" in Ex_first_occurrence) apply clarify apply(case_tac "ma") apply force apply simp apply(case_tac "length path") apply force apply simp apply(erule_tac P = "\i. i < nata \ P i" and x = "nat" for P in allE) apply simp apply clarify apply(erule_tac P = "\i. i < Suc nat \ P i" and x = "nat" for P in allE) apply simp apply(case_tac "j) apply(erule_tac x = "j"in allE) apply force apply(rule_tac x = "j"in exI) apply(force simp add: nth_list_update) apply simp apply(rotate_tac -1) apply(erule_tac x = "length path - 1"in allE) apply(case_tac "length path") apply force apply force done
lemma Graph5: "\ T \ Reach E ; Roots \ Blacks M; \iBtoW(E!i,M); T
R<length E; M!fst(E!R)=Black; M!snd(E!R)=Black; M!T \<noteq> Black\<rbrakk> \<Longrightarrow> (\<exists>r. R<r \<and> r<length E \<and> BtoW(E[R:=(fst(E!R),T)]!r,M))" apply (unfold Reach_def) apply simp apply(erule disjE) prefer 2 apply force apply clarify \<comment> \<open>there exist a black node in the path to T\<close> apply(case_tac "\m apply(erule exE) apply(drule_tac P = "\m. m M!(path!m)=Black" in Ex_first_occurrence) apply clarify apply(case_tac "ma") apply force apply simp apply(case_tac "length path") apply force apply simp apply(erule_tac P = "\i. i < nata \ P i" and x = "nat" for P in allE) apply simp apply clarify apply(erule_tac P = "\i. i < Suc nat \ P i" and x = "nat" for P in allE) apply simp apply(case_tac "j\R") apply(drule le_imp_less_or_eq [of _ R]) apply(erule disjE) apply(erule allE , erule (1) notE impE) apply force apply force apply(rule_tac x = "j"in exI) apply(force simp add: nth_list_update) apply simp apply(rotate_tac -1) apply(erule_tac x = "length path - 1"in allE) apply(case_tac "length path") apply force apply force done
subsubsection \<open>Other lemmas about graphs\<close>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.