This is a really elementary question, and I apologize, but I've been trying to use Coq to prove the following theorem, and just can't seem to figure out how to do it.
(* Binary tree definition. *)
Inductive btree : Type :=
| EmptyTree
| Node : btree -> btree -> btree.
(* Checks if two trees are equal. *)
Fixpoint isEqual (tree1 : btree) (tree2 : btree) : bool :=
match tree1, tree2 with
| EmptyTree, EmptyTree => true
| EmptyTree, _ => false
| _, EmptyTree => false
| Node n11 n12, Node n21 n22 => (andb (isEqual n11 n21) (isEqual n12 n22))
end.
Lemma isEqual_implies_equal : forall tree1 tree2 : btree,
(isEqual tree1 tree2) = true -> tree1 = tree2.
What I have been trying to do is apply induction on tree1 followed by tree2, but this doesn't really work correctly. It seems I need to apply induction to both simultaneously, but can't figure out how.