Theorem add_0_r : forall n:nat, n + 0 = n.
Proof.
intros n. induction n as [| n' IHn'].
- (* n = 0 *) reflexivity.
- (* n = S n' *) simpl. rewrite -> IHn'. reflexivity. Qed.
Theorem plus_n_Sm : forall n m : nat,
S (n + m) = n + (S m).
Proof.
intros n m. induction m as [| m' IHn']. rewrite -> add_0_r. rewrite <- sum.
最后一个策略rewirte <- sum
不起作用。这是目标:
n: ℕ
-------------
S(n) = n + 1
我不知道如何重写n+1
为S(n)
. 我认为这n+1
只是一个符号S(n)
,对吧?