问题
So I have two hypotheses, one that is h : A -> B
, and the other which is h2 : A
. How can I get h3 : B
to appear in my hypotheses?
回答1:
pose proof (h h2) as h3.
introduces h3 : B
as a new hypothesis,
specialize (h h2).
modifies h : A -> B
into h : B
-- this can be useful if you won't need h
later, and symmetrically,
apply h in h2.
converts h2 : A
into h2 : B
.
Another (not very convenient) way would be to
assert B as h3 by exact (h h2).
That's what the pose proof
variant is equivalent to.
Also, in a simple case like the following, you can solve your goal without introducing a new hypothesis:
Goal forall (A B : Prop), (A -> B) -> A -> B.
intros A B h h2.
apply (h h2).
Qed.
来源:https://stackoverflow.com/questions/40448703/combining-two-coq-hypotheses