Is there a way, to apply an hypotesis to our goal in Coq ?
For example:
Hypothesis:
1 subgoal
a : nat
l1 : list nat
l2 : list nat
H : Prefix (a :: l1) l2
IHl1 : Prefix l1 l2 -> sum l1 <= sum l2
Goal
______________________________________(1/1)
sum (a :: l1) <= sum l2
I know that if i could do : apply IHl1 , i could have a result like Prefix (a::l1) l2 and after i will be able to do an assumption ! But i can't do the apply because it's giving me this error : Error: Impossible to unify "sum l1 <= sum l2" with "sum (a :: l1) <= sum l2".
Instructions
Fixpoint
Fixpoint sum (l: list nat) : nat := match l with
| nil => 0
| a::t => a + sum t
end.
Lemma
Lemma parte2_1_c : forall l1 l2, Prefix l1 l2 -> sum l1 <= sum l2.
Proof.
intros.
induction l1.
simpl.
SearchAbout(_<=_).
apply le_0_n.
SearchAbout(sum).
(*must continue but do not know how to do it...*)
So... How may i able to solve this ?