I am having trouble proving that the word_cat
function from Word.thy is associative. This fact seems to be missing from the Word theory itself (or at least find_theorems
and a manual browse of the theory reveals nothing relevant), but I require this lemma to proceed in the proof of another theorem.
More specifically, for the following lemma:
lemma word_cat_assoc:
fixes b1 :: "'a::len word" and b2 :: "'b::len word" and b3 :: "'c::len word"
shows "word_cat b1 (word_cat b2 b3) = word_cat (word_cat b1 b2) b3"
sorry
I'm not even sure how best to proceed, here. I have used find_theorems
to identify that the lemmas word_eq_iff
and word_cat_bl
may be of interest, but any attempt to proceed with these lemmas creates a massive mess. Does anybody have any hints?
More generally, it seems to me that working with the Word library itself is quite awkward, and I would appreciate any tips for working with it. I have at several points in my proofs required a case analysis on the result of a word_split w
for some w
. Using case_tac
causes problems here as new type variables are invented for the word length type variables. Instead, I have to resort to a roundabout form of case analysis, first introducing a cut with subgoal_tac
with explicit lengths, like so:
apply(subgoal_tac "∃b3::8 word. ∃b4::8 word. word_split b1 = (b3, b4)")
and then proceeding using this fact. Presumably there is a better way to work with the library than this?