I've discovered a weird quirk in Coq. It happens when you have a theorem with unnecessary arguments, and we use rewrite with this theorem. For example, consider the following code snippet.
Theorem foo : forall (k : nat) (x : bool), k=0+k.
Proof. reflexivity. Qed.
Theorem bar : forall (k : nat), 0+k=k.
Proof.
intros k. rewrite foo. reflexivity.
(* At this point, the goal is just "bool"! *)
Abort.
In this example, foo has a redundant argument x. Then, when I use rewrite foo in the proof of bar, it generates a goal which just reads "bool".
My first question is: why is such a goal generated?
Second, I've discovered that this goal can be completed using the assumption tactic. But, this doesn't really show how the goal is resolved. What other tactic could be used to complete such a goal?