# HG changeset patch # User urbanc # Date 1314170662 0 # Node ID 580e0632917147a3493f6b73db66ea87cba4bf63 # Parent 300198795eb42373c1e2714ba99d5b8509c999bc just test diff -r 300198795eb4 -r 580e06329171 Higman2.thy --- a/Higman2.thy Tue Aug 23 12:36:43 2011 +0000 +++ b/Higman2.thy Wed Aug 24 07:24:22 2011 +0000 @@ -6,7 +6,7 @@ header {* Higman's lemma *} theory Higman2 -imports Closures +imports Main begin text {* @@ -233,18 +233,28 @@ qed qed -inductive substring ("_ \ _") -where - "[] \ y" -| "x \ y \ c # x \ y" -| "x \ y \ c # x \ c # y" +notation + emb ("_ \ _") + + lemma substring_refl: "x \ x" apply(induct x) -apply(auto intro: substring.intros) +apply(auto intro: emb.intros) done +lemma substring_trans: + assumes a: "x1 \ x2" and b: "x2 \ x3" + shows "x1 \ x3" +using a b +apply(induct arbitrary: x3) +apply(auto intro: emb.intros) +apply(rotate_tac 2) +apply(erule emb.cases) +apply(simp_all) +sorry + definition "SUBSEQ C \ {x. \y \ C. x \ y}" @@ -252,30 +262,56 @@ "SUBSEQ (SUBSEQ C) = SUBSEQ C" unfolding SUBSEQ_def apply(auto) -apply(erule substring.induct) +apply(erule emb.induct) apply(rule_tac x="xb" in bexI) -apply(rule substring.intros) +apply(rule emb.intros) apply(simp) apply(erule bexE) -apply(rule_tac x="ya" in bexI) -apply(rule substring.intros) +apply(rule_tac x="y" in bexI) apply(auto)[2] apply(erule bexE) -apply(rule_tac x="ya" in bexI) -apply(rule substring.intros) -apply(auto)[2] -apply(rule_tac x="x" in exI) -apply(rule conjI) -apply(rule_tac x="y" in bexI) -apply(auto)[2] -apply(rule substring_refl) -done +sorry -lemma +lemma substring_closed: "x \ SUBSEQ C \ y \ x \ y \ SUBSEQ C" unfolding SUBSEQ_def apply(auto) +apply(rule_tac x="xa" in bexI) +apply(rule substring_trans) +apply(auto) +done +lemma "SUBSEQ C \ UNIV" +unfolding SUBSEQ_def +apply(auto) +done + + + +ML {* +@{term "UNIV - (C::string set)"} +*} + +lemma + assumes "finite S" + shows "finite (UNIV - {y. \z \ S. \(z \ y)})" +oops + + + +lemma a: "\x \ SUBSEQ C. \y \ C. x \ y" +unfolding SUBSEQ_def +apply(auto) +done + +lemma b: + shows "\S \ SUBSEQ C. S \{} \ (y \ C \ (\z \ S. \(z \ y)))" +sorry + +lemma "False" +using b a +apply(blast) +done definition "CLOSED C \ C = SUBSEQ C" @@ -341,6 +377,172 @@ show "is_prefix [] f" by simp qed +definition + myeq ("~~") +where + "~~ \ {(x, y). x \ y \ y \ x}" + +abbreviation + myeq_applied ("_ ~~~ _") +where + "x ~~~ y \ (x, y) \ ~~" + + +definition + "minimal x Y \ (x \ Y \ (\y \ Y. y \ x \ x \ y))" + +definition + "downclosed Y \ (\x \ Y. \y. y \ x \ y \ Y)" + + +lemma g: + assumes "minimal x Y" "y ~~~ x" "downclosed Y" + shows "minimal y Y" +using assms +apply(simp add: minimal_def) +apply(rule conjI) +apply(simp add: downclosed_def) +apply(simp add: myeq_def) +apply(auto)[1] +apply(rule ballI) +apply(rule impI) +apply(simp add: downclosed_def) +apply(simp add: myeq_def) +apply(erule conjE) +apply(rotate_tac 5) +apply(drule_tac x="ya" in bspec) +apply(auto)[1] +apply(drule mp) +apply(erule conjE) +apply(rule substring_trans) +apply(auto)[2] +apply(rule substring_trans) +apply(auto)[2] +done + +thm Least_le + +lemma + assumes a: "\(i::nat) j. (f i) \ (f j) \ i < j" + and "downclosed Y" + shows "\S. finite S \ (\x \ Y. \y \ S. \ (y \ x))" +proof - + def Ymin \ "{x. minimal x Y}" + have "downclosed Ymin" + unfolding Ymin_def downclosed_def + apply(auto) + apply(simp add: minimal_def) + apply(rule conjI) + using assms(2) + apply(simp add: downclosed_def) + apply(auto)[1] + apply(rule ballI) + apply(rule impI) + apply(erule conjE) + apply(drule_tac x="ya" in bspec) + apply(simp) + apply(drule mp) + apply(rule substring_trans) + apply(auto)[2] + apply(rule substring_trans) + apply(auto)[2] + done + def Yeq \ "Ymin // ~~" + def Ypick \ "(\X. SOME x. x \ X) ` Yeq" + have "finite Ypick" sorry + moreover + thm LeastI_ex + have "(\x \ Y. \y \ Ypick. (\ (y \ x)))" + apply(rule ballI) + apply(subgoal_tac "\y. y \ Ypick") + apply(erule exE) + apply(rule_tac x="y" in bexI) + apply(subgoal_tac "y \ Ymin") + apply(simp add: Ymin_def minimal_def) + apply(subgoal_tac "~~ `` {y} \ Yeq") + apply(simp add: Yeq_def quotient_def Image_def) + apply(erule bexE) + apply(simp add: Ymin_def) + apply(subgoal_tac "y ~~~ xa") + apply(drule g) + apply(assumption) + apply(rule assms(2)) + apply(simp add: minimal_def) + apply(erule conjE) + apply(drule_tac x="x" in bspec) + apply(assumption) + +lemma + assumes a: "\(i::nat) j. (f i) \ (f j) \ i < j" + and b: "downclosed Y" + and c: "Y \ {}" + shows "\S. finite S \ (Y = {y. (\z \ S. \(z \ y))})" +proof - + def Ybar \ "- Y" + def M \ "{x \ Ybar. minimal x Ybar}" + def Cpre \ "M // ~~" + def C \ "(\X. SOME x. x \ X) ` Cpre" + have "finite C" sorry + moreover + have "\x \ Y. \y \ C. y \ x" sorry + then have "\x. (x \ Ybar) \ (\z \ C. z \ x)" + apply(auto simp add: Ybar_def) + apply(rule allI) + apply(rule iffI) + prefer 2 + apply(erule bexE) + apply(case_tac "x \ Y") + prefer 2 + apply(simp add: Ybar_def) + apply(subgoal_tac "z \ Y") + apply(simp add: C_def) + apply(simp add: Cpre_def) + apply(simp add: M_def Ybar_def) + apply(simp add: quotient_def) + apply(simp add: myeq_def) + apply(simp add: image_def) + apply(rule_tac x="x" in exI) + apply(simp) + apply(rule conjI) + apply(simp add: minimal_def) + apply(rule ballI) + apply(simp) + apply(rule impI) + prefer 3 + apply(simp add: Ybar_def) + apply(rule notI) + apply(simp add: C_def Cpre_def M_def Ybar_def quotient_def) + + prefer 2 + apply(rule someI2_ex) + apply(rule_tac x="x" in exI) + apply(simp add: substring_refl) + apply(auto)[1] + using b + apply - + sorry + ultimately + have "\S. finite S \ (\y. y \ Y = (\z \ S. \(z \ y)))" + apply - + apply(rule_tac x="C" in exI) + apply(simp) + apply(rule allI) + apply(rule iffI) + apply(drule_tac x="y" in spec) + apply(simp add: Ybar_def) + apply(simp add: Ybar_def) + apply(case_tac "y \ Y") + apply(simp) + apply(drule_tac x="y" in spec) + apply(simp) + done + then show ?thesis + by (auto) +qed + + +thm higman_idx + text {* Weak version: only yield sequence containing words that can be embedded into each other.