christian's
authorChengsong
Thu, 07 Apr 2022 21:38:01 +0100
changeset 481 feacb89b784c
parent 480 574749f5190b
child 482 4bf2367e6e53
christian's
thys2/BasicIdentities.thy
--- a/thys2/BasicIdentities.thy	Thu Apr 07 21:31:29 2022 +0100
+++ b/thys2/BasicIdentities.thy	Thu Apr 07 21:38:01 2022 +0100
@@ -93,9 +93,22 @@
   apply simp
   using distinct_not_exist by fastforce
 
+
 lemma distinct_rdistinct_append:
-  shows "distinct rs1 \<Longrightarrow> rdistinct (rs1 @ rsa) {} = rs1 @ (rdistinct rsa (set rs1))"
-  sorry
+  assumes "distinct rs1" "\<forall>r \<in> set rs1. r \<notin> acc"
+  shows "rdistinct (rs1 @ rsa) acc = rs1 @ (rdistinct rsa (acc \<union> set rs1))"
+  using assms
+  apply(induct rs1 arbitrary: rsa acc)
+   apply(auto)[1]
+  apply(auto)[1]
+  apply(drule_tac x="rsa" in meta_spec)
+  apply(drule_tac x="{a} \<union> acc" in meta_spec)
+  apply(simp)
+  apply(drule meta_mp)
+   apply(auto)[1]
+  apply(simp)
+  done
+  
 
 lemma rdistinct_concat_general:
   shows "rdistinct (rs1 @ rs2) {} = (rdistinct rs1 {}) @ (rdistinct rs2 (set rs1))"