93 OF wf_mult[OF wf_trancl[OF wf_R]]], OF subset] |
92 OF wf_mult[OF wf_trancl[OF wf_R]]], OF subset] |
94 note lprod = wf_subset[OF lprodtrancl, where p="lprod R", OF lprod_subset, simplified] |
93 note lprod = wf_subset[OF lprodtrancl, where p="lprod R", OF lprod_subset, simplified] |
95 show ?thesis by (auto intro: lprod) |
94 show ?thesis by (auto intro: lprod) |
96 qed |
95 qed |
97 |
96 |
98 constdefs |
97 definition gprod_2_2 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" where |
99 gprod_2_2 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" |
|
100 "gprod_2_2 R \<equiv> { ((a,b), (c,d)) . (a = c \<and> (b,d) \<in> R) \<or> (b = d \<and> (a,c) \<in> R) }" |
98 "gprod_2_2 R \<equiv> { ((a,b), (c,d)) . (a = c \<and> (b,d) \<in> R) \<or> (b = d \<and> (a,c) \<in> R) }" |
101 gprod_2_1 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" |
99 |
|
100 definition gprod_2_1 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" where |
102 "gprod_2_1 R \<equiv> { ((a,b), (c,d)) . (a = d \<and> (b,c) \<in> R) \<or> (b = c \<and> (a,d) \<in> R) }" |
101 "gprod_2_1 R \<equiv> { ((a,b), (c,d)) . (a = d \<and> (b,c) \<in> R) \<or> (b = c \<and> (a,d) \<in> R) }" |
103 |
102 |
104 lemma lprod_2_3: "(a, b) \<in> R \<Longrightarrow> ([a, c], [b, c]) \<in> lprod R" |
103 lemma lprod_2_3: "(a, b) \<in> R \<Longrightarrow> ([a, c], [b, c]) \<in> lprod R" |
105 by (auto intro: lprod_list[where a=c and b=c and |
104 by (auto intro: lprod_list[where a=c and b=c and |
106 ah = "[a]" and at = "[]" and bh="[b]" and bt="[]", simplified]) |
105 ah = "[a]" and at = "[]" and bh="[b]" and bt="[]", simplified]) |
168 lemma lprod_3_7: assumes z': "(z',z) \<in> R" shows "([x, z', y], [x, y, z]) \<in> lprod R" |
167 lemma lprod_3_7: assumes z': "(z',z) \<in> R" shows "([x, z', y], [x, y, z]) \<in> lprod R" |
169 apply (rule lprod_list[where a="y" and b="y" and ah="[x, z']" and at="[]" and bh="[x]" and bt="[z]", simplified]) |
168 apply (rule lprod_list[where a="y" and b="y" and ah="[x, z']" and at="[]" and bh="[x]" and bt="[z]", simplified]) |
170 apply (simp add: z' lprod_2_4) |
169 apply (simp add: z' lprod_2_4) |
171 done |
170 done |
172 |
171 |
173 constdefs |
172 definition perm :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set \<Rightarrow> bool" where |
174 perm :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set \<Rightarrow> bool" |
|
175 "perm f A \<equiv> inj_on f A \<and> f ` A = A" |
173 "perm f A \<equiv> inj_on f A \<and> f ` A = A" |
176 |
174 |
177 lemma "((as,bs) \<in> lprod R) = |
175 lemma "((as,bs) \<in> lprod R) = |
178 (\<exists> f. perm f {0 ..< (length as)} \<and> |
176 (\<exists> f. perm f {0 ..< (length as)} \<and> |
179 (\<forall> j. j < length as \<longrightarrow> ((nth as j, nth bs (f j)) \<in> R \<or> (nth as j = nth bs (f j)))) \<and> |
177 (\<forall> j. j < length as \<longrightarrow> ((nth as j, nth bs (f j)) \<in> R \<or> (nth as j = nth bs (f j)))) \<and> |