equal
deleted
inserted
replaced
3443 by force |
3443 by force |
3444 |
3444 |
3445 lemma remdups_adj_altdef: "(remdups_adj xs = ys) \<longleftrightarrow> |
3445 lemma remdups_adj_altdef: "(remdups_adj xs = ys) \<longleftrightarrow> |
3446 (\<exists>f::nat => nat. mono f & f ` {0 ..< size xs} = {0 ..< size ys} |
3446 (\<exists>f::nat => nat. mono f & f ` {0 ..< size xs} = {0 ..< size ys} |
3447 \<and> (\<forall>i < size xs. xs!i = ys!(f i)) |
3447 \<and> (\<forall>i < size xs. xs!i = ys!(f i)) |
3448 \<and> (\<forall>i. i + 1 < size xs \<longrightarrow> (xs!i = xs!(i+1) <-> f i = f(i+1))))" (is "?L \<longleftrightarrow> (\<exists>f. ?p f xs ys)") |
3448 \<and> (\<forall>i. i + 1 < size xs \<longrightarrow> (xs!i = xs!(i+1) \<longleftrightarrow> f i = f(i+1))))" (is "?L \<longleftrightarrow> (\<exists>f. ?p f xs ys)") |
3449 proof |
3449 proof |
3450 assume ?L |
3450 assume ?L |
3451 then show "\<exists>f. ?p f xs ys" |
3451 then show "\<exists>f. ?p f xs ys" |
3452 proof (induct xs arbitrary: ys rule: remdups_adj.induct) |
3452 proof (induct xs arbitrary: ys rule: remdups_adj.induct) |
3453 case (1 ys) |
3453 case (1 ys) |