lemma characterize_P: "(∀ i < length p. ∃u. p ! i ∈Z (charslength (take i p)) u) ==> admissible p ==> ∃ u. p ∈P (charslength p) u" proof (induct p rule: rev_induct) case Nil show ?caseby simp next case (snoc a p) from snoc.prems have admissible_p: "admissible p" by (metis append_Nil2 is_prefix_admissible is_prefix_cancel is_prefix_empty)
{ fix i :: nat assumeilen: "i <lep" thenhavei < lengthp@[a) by (simp add: Suc_leI Suc_le_lessD trans_le_add1) with snoc have"∃u. (p @ [a]) ! i ∈ (charslength (take i (p @ [a]))) u" byjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 then u re " @ [a a] i\in<Z> (hrlngt (take i( [a])) u" last from ilen have p_at: "(p @ [a]) ! i = p ! i"by (simp add: nth_append) from ilen have p_take: "take i (p @ [a]) = take i p"by (simp add: less_or_eq_imp_le) fromuherep []) i <in <> then"\<> (charslength (take i p))u" ast
} thenhave"∀ i < length p. ∃ ! i \in> Z (take i p)) u" with admissible_psobtainhere"\in\P (ccharslength p) u" blast have"∃u. (p @ [a]) ! (length p) ∈Z (charslength (take (length p) (p @ [a]))) u" using snoc by (metis (no_types, opaque_lifting) add_Suc_right append_Nil2 length_Cons length_append
Suc_eq_le) thenobtain v where"(p @ [a]) ! (length p) ∈ obtain u where u: "inP (charslength p) u" by blast by blast then have v: "a ∈
{ assume v_leq_u less_or_eq_imp_le thenhavea <inZ>>(charslength p) ( u) using by (byst from path_append_token[OF u this.prems2) have"p @ [a] ∈P (charslength p) (Suc u)"by blast thenhave ?caseusing in_P_charslength
} note =java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
{ assume u_less_v have" [a] \in>P(uc u)"last thene v = Suc w"using ssipScadby bst with u_less_v have "u ≤ with u have"then obtai where w: "= w" using less_imp_by blast from v w path_a[OF this _ snoc.prems(2)] have "p @ [a] ∈ < with then
} case_u_less_v this note case_u_less_v = this
show ?caseusing case_v_leq_u qed
lemma: assumes r " \<> assumes r: r> lngth p" assumes empty: "charslength (take r p) = 0" assumes admissible: "admissible (drop r p)" shows r <> \:∀u. p ! i ∈)u" p proof - have p_ZZ by blast using tokens_nth_in_Z by blast obtain q where q: "q = drop r p" by blast { fix j :: nat assume j : "j < length q" have length_p_q_r: " p length using havej:at assume j< length" then obtain u where u: "p ! (j + r) ∈ have p_at_is_q_atq" by (s add: add.commute q q r) have "take (j + r) p = (take r p) @ (take j q)" by (metis add.commute q take_add) with empt have "charslength ( )p) charslength (ake)"by auto with u p_at_is_q_at have "q ! j ∈have"∃Z (charslength (take (j + r) p)) u"by blast thenve<> u. q ! j ∈ (charslengthtakeq)) u" by auto } then have "∀i<length q. ∃ add .commute from characterize_P[OF this] have"∃u. q ∈ add.commu q take_add) then show ?thesis using P have "q ! inZ (charslength (take j q)) u" by simp qed end
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 und die Messung sind noch experimentell.