I have two hypothesis, and I would like to use forward reasoning to apply a theorem that uses both of them.
My specific I have the hypothes
H0 : a + b = c + d
H1 : e + f = g + h
and I want to apply the theorem from the standard library:
f_equal2_mult
: forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 * x2 = y1 * y2
Now I know I could manually give the values for x1, y1, x2, y2, but I would like Coq to automatically determine those values when it unified with H0
and H1
. I have figured out that I can get it to work like so:
eapply f_equal2_mult in H0; try exact H1.
But this feels like a hack, with the broken symmetry and the try
. I really would like to be able to say apply f_equals2_mult in H0, H1
or something similarly clear. Is there a way like this?
You could use
pose proof
to introduce the lemma in the context, andspecialize
to apply it to other hypotheses.