569 (*>*) |
569 (*>*) |
570 |
570 |
571 code_pred %quote lexord |
571 code_pred %quote lexord |
572 (*<*) |
572 (*<*) |
573 proof - |
573 proof - |
574 fix r a1 |
574 fix r xs ys |
575 assume lexord: "lexord r a1" |
575 assume lexord: "lexord r (xs, ys)" |
576 assume 1: "\<And> xs ys a v. a1 = (xs, ys) \<Longrightarrow> append xs (a # v) ys \<Longrightarrow> thesis" |
576 assume 1: "\<And> r' xs' ys' a v. r = r' \<Longrightarrow> (xs, ys) = (xs', ys') \<Longrightarrow> append xs' (a # v) ys' \<Longrightarrow> thesis" |
577 assume 2: "\<And> xs ys u a v b w. a1 = (xs, ys) \<Longrightarrow> append u (a # v) xs \<Longrightarrow> append u (b # w) ys \<Longrightarrow> r (a, b) \<Longrightarrow> thesis" |
577 assume 2: "\<And> r' xs' ys' u a v b w. r = r' \<Longrightarrow> (xs, ys) = (xs', ys') \<Longrightarrow> append u (a # v) xs' \<Longrightarrow> append u (b # w) ys' \<Longrightarrow> r' (a, b) \<Longrightarrow> thesis" |
578 obtain xs ys where a1: "a1 = (xs, ys)" by fastsimp |
|
579 { |
578 { |
580 assume "\<exists>a v. ys = xs @ a # v" |
579 assume "\<exists>a v. ys = xs @ a # v" |
581 from this 1 a1 have thesis |
580 from this 1 have thesis |
582 by (fastsimp simp add: append) |
581 by (fastsimp simp add: append) |
583 } moreover |
582 } moreover |
584 { |
583 { |
585 assume "\<exists>u a b v w. (a, b) \<in> r \<and> xs = u @ a # v \<and> ys = u @ b # w" |
584 assume "\<exists>u a b v w. (a, b) \<in> r \<and> xs = u @ a # v \<and> ys = u @ b # w" |
586 from this 2 a1 have thesis by (fastsimp simp add: append mem_def) |
585 from this 2 have thesis by (fastsimp simp add: append mem_def) |
587 } moreover |
586 } moreover |
588 note lexord[simplified a1] |
587 note lexord |
589 ultimately show thesis |
588 ultimately show thesis |
590 unfolding lexord_def |
589 unfolding lexord_def |
591 by (fastsimp simp add: Collect_def) |
590 by (fastsimp simp add: Collect_def) |
592 qed |
591 qed |
593 (*>*) |
592 (*>*) |