reflexivity
can prove things like 5 = 5
or a + b = a + b
, that is, where both sides of the equal sign are syntactically equal.
Coq also allows eta expansion
, i.e. unfolding of defintion, and beta reduction
i.e. applying a lambda expression to an argument, when comparing if two terms are equal. This is called that the terms are convertible
in the Coq world.
Now, back to your question, n * 0
and 0
are not convertible, so you need to prove that they are equal, which is called being propositionally equal.
Why are they not convertible? Well, if you expand *
to mult
to get mult n 0
and replace mult
with its definition, which is
Definition mult := fix mul n m := match n with 0 => 0 | S n' => m + mul n' m end.
you have
(fix mul n m := match n with 0 => 0 | S n' => m + mul n' m end) n 0
and next do beta reduction
(applying the lambda on its args), you (kind of) get the term
match n with 0 => 0 | S n' => 0 + mul n' 0 end
which is not syntactically equal to 0
.
And here the builtin equivalence check ("convertibility") stops. It does not have any way of simplifying the match n with ...
any more. (The only way to do that is if the thing that was being matched on was an expression that reduced to something that starts with a constructor, not a function or a variable)
Since the convertibility check doesn't solve it, you have to come up with another way to prove the equivalence.
To do that, you have more powerful tools at your hands than plain convertibility. You can apply theorems (induction, or mult_n_0), fold expressions, etc. But that power means that it is hard to search for the proof automatically, and some ingenuity is needed.
There are of course some who have made tactics ("coq commands") with useful heuristics, that try a number of useful tricks that "often work", but reflexivity
is not one of them. It just looks for convertibility (and a little more, which is besides the point here).
I hope this explains "why it doesn't work".