another problem from SFv1 which got me stuck.
The theorem is as follows:
Theorem plus_le_compat_l : forall n m p,
n <= m ->
p + n <= p + m.
I have tried several avenues so far, the one that got me the furthest was to introduce n
and start induction on it. The base case is rather trivial (intros m p H. rewrite add_0_r. apply le_plus_l.
).
As for the inductive step, I have tried to destruct p
, which gives me two subcases. For the first where p = O
, it's super easy to prove by applying H
. When p = S n
I get stuck. Here's the full proof so far:
Theorem plus_le_compat_l : forall n m p,
n <= m ->
p + n <= p + m.
Proof.
intros n.
induction n as [| n' IHn'].
- intros m p H. rewrite add_0_r. apply le_plus_l.
- destruct p eqn:E.
+ intros H. simpl. apply H.
+ intros H. simpl. apply n_le_m__Sn_le_Sm.
And my current goal:
n' : nat
IHn' : forall m p : nat, n' <= m -> p + n' <= p + m
m, p, n : nat
E : p = S n
H : S n' <= m
============================
n + S n' <= n + m
I tried a trivial manipulation to turn the LHS of the inequality into n' + S n
which lets me rewrite
the S n
as p
, but that also doesn't take me anywhere.
Any hints here are highly appreciated :-)
Thanks
PS: I have tried to apply a previously proved theorem without success:
Theorem add_le_cases : forall n m p q,
n + m <= p + q -> n <= p \/ m <= q.