I have two hypotheses
IHl: forall (lr : list nat) (d x : nat), d = x \/ In x l' -> (something else)
Head : d = x
I want to apply IHl
on Head
as it satisfies d = x \/ In x l
of IHl. I tried apply with
tactic which fails with a simple hint Error: Unable to unify
.
Which tactic should I use to instantiate variables in a hypothesis?
contradiction. If there is a hypothesis that is equivalent to False or two contradictory hypotheses in the context, you can use the contradiction tactic to prove any goal.
Tactics specify how to transform the proof state of an incomplete proof to eventually generate a complete proof. Proofs can be developed in two basic ways: In forward reasoning, the proof begins by proving simple statements that are then combined to prove the theorem statement as the last step of the proof.
Your hypothesis IHl
takes 4 arguments: lr : list nat
, d : nat
, x : nat
, and _ : d = x \/ In x l'
.
Your hypothesis Head : d = x
does not have the proper type to be passed as the 4th argument. You need to turn it from a proof of equality into a proof of a disjunction. Fortunately, you can use:
or_introl
: forall A B : Prop, A -> A \/ B
which is one of the two constructors of the or
type.
Now you might have to pass explicitly the B
Prop, unless it can be figured out in the context by unification.
Here are things that should work:
(* To keep IHl but use its result, given lr : list nat *)
pose proof (IHl lr _ _ (or_introl Head)).
(* To transform IHl into its result, given lr : list nat *)
specialize (IHl lr _ _ (or_introl Head)).
There's probably an apply
you can use, but depending on what is implicit/inferred for you, it's hard for me to tell you which one it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With