Javier Diaz said:
I think the easiest way to prove your lemma is not by induction on the combined length of the arguments of
addBinNum
but by computation induction as follows:lemma (in th2) addMeaningF_4: "evalBinNum_1 (addBinNum x y) = plus (evalBinNum_1 x) (evalBinNum_1 y)" using assoc and commute by (induction rule: addBinNum.induct, auto) (metis arith_1)+
Please note that it's necessary to add both associativity and commutativity lemmas to your definition of
plus
inth2
as follows (proofs are left as exercises):lemma (in th2) commute: "plus x y = plus y x" sorry lemma (in th2) assoc: "plus (plus x y) z = plus x (plus y z)" sorry
Thank you Javier, super helpful!
Lekhani Ray has marked this topic as resolved.
Last updated: Dec 21 2024 at 16:20 UTC