【发布时间】:2019-12-10 12:29:41
【问题描述】:
我试图证明这两个加法函数在扩展上是相同的,但是我什至无法证明第二个的最简单引理。如何证明非原始递归加法函数?
Fixpoint myadd1 (m n : nat) : nat :=
match m, n with
| 0, n => n
| (S m), n => S (myadd1 m n)
end.
Fixpoint myadd2 (m n : nat) : nat :=
match m, n with
| 0, n => n
| (S m), n => myadd2 m (S n)
end.
Lemma succlem1 : forall (m n : nat),
(myadd1 m 0) = m.
Proof.
intros. induction m.
- simpl. reflexivity.
- simpl. rewrite IHm.
reflexivity.
Qed.
Lemma succlem12 : forall (m n : nat),
(myadd2 m 0) = m.
Proof.
intros. induction m.
- reflexivity.
- simpl.
Abort.
编辑:
这就是我想要证明的,也是我被引到这个引理的原因。
Lemma succlem : forall (m n : nat),
S (myadd2 m 0) = myadd2 m 1.
Proof.
intros. induction m.
- simpl. reflexivity.
- simpl. rewrite <- IHm.
simpl.
Theorem succHomo : forall (m n : nat),
S (myadd2 m n) = myadd2 m (S n).
Proof.
intros.
induction n.
- simpl. reflexivity.
- simpl.
inversion IHm.
Theorem equivadds : forall (m n : nat),
myadd1 m n = myadd2 m n.
Proof.
intros.
induction m.
- simpl. reflexivity.
- intros.
simpl.
rewrite IHm.
symmetry.
【问题讨论】: