I'm not an expert on coinduction myself, but coinduction is not required here. I'm not an expert on codatatypes either, but anyway, here's a proof:
lemma sset_cycle [simp]:
assumes "xs ≠ []"
shows "sset (cycle xs) = set xs"
proof
have "set xs ⊆ set xs ∪ sset (cycle xs)" by blast
also have "… = sset (xs @- cycle xs)" by simp
also from ‹xs ≠ []› have "xs @- cycle xs = cycle xs"
by (rule cycle_decomp [symmetric])
finally show "set xs ⊆ sset (cycle xs)" .
next
from assms have "cycle xs !! n ∈ set xs" for n
proof (induction n arbitrary: xs)
case (Suc n xs)
have "tl xs @ [hd xs] ≠ []" by simp
hence "cycle (tl xs @ [hd xs]) !! n ∈ set (tl xs @ [hd xs])" by (rule Suc.IH)
also have "cycle (tl xs @ [hd xs]) !! n = cycle xs !! Suc n" by simp
also have "set (tl xs @ [hd xs]) = set (hd xs # tl xs)" by simp
also from ‹xs ≠ []› have "hd xs # tl xs = xs" by simp
finally show ?case .
qed simp_all
thus "sset (cycle xs) ⊆ set xs" by (auto simp: sset_range)
qed
UPDATE: The following proof is a bit nicer:
lemma sset_cycle [simp]:
assumes "xs ≠ []"
shows "sset (cycle xs) = set xs"
proof
have "set xs ⊆ set xs ∪ sset (cycle xs)" by blast
also have "… = sset (xs @- cycle xs)" by simp
also from ‹xs ≠ []› have "xs @- cycle xs = cycle xs"
by (rule cycle_decomp [symmetric])
finally show "set xs ⊆ sset (cycle xs)" .
next
show "sset (cycle xs) ⊆ set xs"
proof
fix x assume "x ∈ sset (cycle xs)"
from this and ‹xs ≠ []› show "x ∈ set xs"
proof (induction "cycle xs" arbitrary: xs)
case (stl x xs)
have "x ∈ set (tl xs @ [hd xs])" by (intro stl) simp_all
also have "set (tl xs @ [hd xs]) = set (hd xs # tl xs)" by simp
also from ‹xs ≠ []› have "hd xs # tl xs = xs" by simp
finally show ?case .
qed simp_all
qed
qed