In Lean I occasionally want to apply a rw
tactic to exactly one of multiple identical terms. For example I have the goal
⊢ 0 = 0
and I want to rw
it to
⊢ a * 0 = 0
I also have
mul_zero (a : mynat) :
a * 0 = 0
Now I should be able to just rewrite the 0
to a * 0
. However trying
rw ← zero_mul a,
gives me
⊢ a * 0 = a * 0
Which is not what I want!
Is there a reason lean does this and is there some way to apply a rewrite to only one term?