diff -r 146b4817aebd -r 9deaff82e0c5 thys/Positions.thy --- a/thys/Positions.thy Thu Jun 29 17:57:41 2017 +0100 +++ b/thys/Positions.thy Fri Jun 30 17:41:45 2017 +0100 @@ -61,30 +61,9 @@ apply(case_tac ys) apply(simp_all) apply (smt intlen_bigger) -(* HERE *) -oops - - -lemma intlen_length: - assumes "length xs < length ys" - shows "intlen xs < intlen ys" -using assms -apply(induct xs arbitrary: ys) -apply(auto) -apply(case_tac ys) -apply(simp_all) -apply (smt intlen_bigger) +apply (smt Suc_mono intlen.simps(2) length_Suc_conv less_antisym) by (smt Suc_lessE intlen.simps(2) length_Suc_conv) -lemma length_intlen: - assumes "intlen xs < intlen ys" - shows "length xs < length ys" -using assms -apply(induct xs arbitrary: ys) -apply(auto) -apply(case_tac ys) -apply(simp_all) -by (smt intlen_bigger) definition pflat_len :: "val \ nat list => int" @@ -120,15 +99,15 @@ section {* Orderings *} -definition prefix_list:: "'a list \ 'a list \ bool" ("_ \pre _") +definition prefix_list:: "'a list \ 'a list \ bool" ("_ \pre _" [60,59] 60) where "ps1 \pre ps2 \ \ps'. ps1 @ps' = ps2" -definition sprefix_list:: "'a list \ 'a list \ bool" ("_ \spre _") +definition sprefix_list:: "'a list \ 'a list \ bool" ("_ \spre _" [60,59] 60) where "ps1 \spre ps2 \ ps1 \pre ps2 \ ps1 \ ps2" -inductive lex_list :: "nat list \ nat list \ bool" ("_ \lex _") +inductive lex_list :: "nat list \ nat list \ bool" ("_ \lex _" [60,59] 60) where "[] \lex (p#ps)" | "ps1 \lex ps2 \ (p#ps1) \lex (p#ps2)" @@ -139,9 +118,8 @@ assumes "ps1 \lex ps2" shows "ps1 \ ps2" using assms -apply(induct rule: lex_list.induct) -apply(auto) -done +by(induct rule: lex_list.induct)(auto) + lemma lex_simps [simp]: fixes xs ys :: "nat list" @@ -169,8 +147,7 @@ apply(simp_all) done - -lemma trichotomous: +lemma lex_trichotomous: fixes p q :: "nat list" shows "p = q \ p \lex q \ q \lex p" apply(induct p arbitrary: q) @@ -196,9 +173,6 @@ where "v1 :\val v2 \ (\p. v1 \val p v2)" - - - definition val_ord_ex1:: "val \ val \ bool" ("_ :\val _") where "v1 :\val v2 \ v1 :\val v2 \ v1 = v2" @@ -210,7 +184,7 @@ apply(auto simp add: val_ord_ex_def val_ord_def) apply(case_tac p) apply(simp add: pflat_len_simps) -apply(drule length_intlen) +apply(simp add: intlen_length) apply(simp) apply(drule_tac x="[]" in bspec) apply(simp add: Pos_empty) @@ -493,7 +467,7 @@ apply(clarify) apply(subgoal_tac "p = pa \ p \lex pa \ pa \lex p") prefer 2 -apply(rule trichotomous) +apply(rule lex_trichotomous) apply(erule disjE) apply(simp) apply(rule_tac x="pa" in exI) @@ -885,7 +859,7 @@ apply(simp (no_asm) add: val_ord_def) apply(rule_tac x="[]" in exI) apply(simp add: pflat_len_simps) -apply(rule intlen_length) +apply(simp only: intlen_length) apply (metis Posix1(2) append_assoc append_eq_conv_conj drop_eq_Nil not_le) apply(subgoal_tac "length (flat v1a) \ length s1") prefer 2