Let us assume that we want to prove the following (totally contrived) lemma.
Lemma lem : (forall n0 : nat, 0 <= n0 -> 0 <= S n0) -> forall n, le 0 n.
We want to apply nat_ind
to prove it. Here is a possible proof:
Proof.
intros H n. apply nat_ind. constructor. exact H.
Qed.
But why not directly using H
in the apply tactic, using something like apply (nat_ind _ _ H)
or eapply (nat_ind _ _ H)
? But the first one fails, and the second one hides the remaining goal in an existential variable.
Is it possible in apply
or its derivatives to skip hypotheses in order to specify the other arguments while keeping them as classic goals in the remainder of the proof ?
intros n H.
should beintros H n.
– Anton TrunovP 0
a.k.a.0 <= 0
, since this works:apply (nat_ind _ (le_n _) H).
– Anton Trunov0 <= 0
. – eponier