I am working on the proof of the following theorem Sn_le_Sm__n_le_m
in IndProp.v
of Software Foundations (Vol 1: Logical Foundations).
Theorem Sn_le_Sm__n_le_m : ∀n m,
S n ≤ S m → n ≤ m.
Proof.
intros n m HS.
induction HS as [ | m' Hm' IHm'].
- (* le_n *) (* Failed Here *)
- (* le_S *) apply IHSm'.
Admitted.
where, the definition of le (i.e., ≤)
is:
Inductive le : nat → nat → Prop :=
| le_n n : le n n
| le_S n m (H : le n m) : le n (S m).
Notation "m ≤ n" := (le m n).
Before induction HS
, the context as well as the goal is as follows:
n, m : nat
HS : S n <= S m
______________________________________(1/1)
n <= m
At the point of the first bullet -
, the context as well as the goal is:
n, m : nat
______________________________________(1/1)
n <= m
where we have to prove n <= m
without any context, which is obviously impossible.
Why does it not generate S n = S m
(and then n = m
) for the le_n
case in induction HS
?
[coq] induction
). Short answer: before you doinduction
on a relation, useremember (subexpr) as var
to make it a primitive form e.g.x <= y
wherex
andy
are just variables. Then you can preserve necessary information afterinduction
. – Candidependent induction
tactic. (I might turn this into a full answer later.) – Gould