You can solve this problem via:
lemma f_wrapper_range: "Union ({x. (EX r. x = f_wrapper r)}) = {1,2}"
by (auto simp add: f_wrapper_def num_wrapper_t.splits)
To be slightly clearer:
lemma f_wrapper_range: "Union ({x. (EX r. x = f_wrapper r)}) = {1,2}"
proof -
have exs: "EX x. num x = ONE" "EX x. num x ~= ONE"
by (simp_all add: num_wrapper_t.splits exI[where x=TWO])
thus ?thesis
by (auto simp add: f_wrapper_def)
qed
What you need to show is that there are objects in the num_wrapper_t
type with num taking both values. That's not syntactically clear: if num
x had a more limited range, f_wrapper would too.
Yours,
Thomas.