768 |
768 |
769 subsubsection \<open>Lexicographic combinations\<close> |
769 subsubsection \<open>Lexicographic combinations\<close> |
770 |
770 |
771 definition lex_prod :: "('a \<times>'a) set \<Rightarrow> ('b \<times> 'b) set \<Rightarrow> (('a \<times> 'b) \<times> ('a \<times> 'b)) set" |
771 definition lex_prod :: "('a \<times>'a) set \<Rightarrow> ('b \<times> 'b) set \<Rightarrow> (('a \<times> 'b) \<times> ('a \<times> 'b)) set" |
772 (infixr "<*lex*>" 80) |
772 (infixr "<*lex*>" 80) |
773 where "ra <*lex*> rb = {((a, b), (a', b')). a \<noteq> a' \<and> (a, a') \<in> ra \<or> a = a' \<and> (b, b') \<in> rb}" |
773 where "ra <*lex*> rb = {((a, b), (a', b')). (a, a') \<in> ra \<or> a = a' \<and> (b, b') \<in> rb}" |
774 |
774 |
775 lemma in_lex_prod[simp]: "NO_MATCH less_than r \<Longrightarrow> ((a, b), (a', b')) \<in> r <*lex*> s \<longleftrightarrow> a \<noteq> a' \<and> (a, a') \<in> r \<or> a = a' \<and> (b, b') \<in> s" |
775 lemma in_lex_prod[simp]: "((a, b), (a', b')) \<in> r <*lex*> s \<longleftrightarrow> (a, a') \<in> r \<or> a = a' \<and> (b, b') \<in> s" |
776 by (auto simp:lex_prod_def) |
|
777 |
|
778 text\<open>compared with @{thm[source]in_lex_prod} this yields simpler results\<close> |
|
779 lemma in_lex_prod_less_than[simp]: "((a, b), (a', b')) \<in> less_than <*lex*> s \<longleftrightarrow>a<a' \<or> a = a' \<and> (b, b') \<in> s" |
|
780 by (auto simp:lex_prod_def) |
776 by (auto simp:lex_prod_def) |
781 |
777 |
782 lemma wf_lex_prod [intro!]: |
778 lemma wf_lex_prod [intro!]: |
783 assumes "wf ra" "wf rb" |
779 assumes "wf ra" "wf rb" |
784 shows "wf (ra <*lex*> rb)" |
780 shows "wf (ra <*lex*> rb)" |
801 then show "P z" |
797 then show "P z" |
802 by (simp add: zeq) |
798 by (simp add: zeq) |
803 qed auto |
799 qed auto |
804 |
800 |
805 text \<open>\<open><*lex*>\<close> preserves transitivity\<close> |
801 text \<open>\<open><*lex*>\<close> preserves transitivity\<close> |
806 lemma trans_lex_prod [simp,intro!]: "\<lbrakk>trans R1; trans R2; antisym R1\<rbrakk> \<Longrightarrow> trans (R1 <*lex*> R2)" |
802 lemma trans_lex_prod [simp,intro!]: "trans R1 \<Longrightarrow> trans R2 \<Longrightarrow> trans (R1 <*lex*> R2)" |
807 unfolding trans_def antisym_def lex_prod_def by blast |
803 unfolding trans_def lex_prod_def by blast |
808 |
|
809 |
804 |
810 lemma total_on_lex_prod [simp]: "total_on A r \<Longrightarrow> total_on B s \<Longrightarrow> total_on (A \<times> B) (r <*lex*> s)" |
805 lemma total_on_lex_prod [simp]: "total_on A r \<Longrightarrow> total_on B s \<Longrightarrow> total_on (A \<times> B) (r <*lex*> s)" |
811 by (auto simp: total_on_def) |
806 by (auto simp: total_on_def) |
812 |
807 |
813 lemma asym_lex_prod: "\<lbrakk>asym R; asym S\<rbrakk> \<Longrightarrow> asym (R <*lex*> S)" |
808 lemma asym_lex_prod: "\<lbrakk>asym R; asym S\<rbrakk> \<Longrightarrow> asym (R <*lex*> S)" |