`induction n, m` 和 `induction n; 有什么区别? Coq 中的感应 m`?

What is the difference of `induction n, m` and `induction n; induction m` in Coq?

我很难认为 induction n, m 会为 nm 创建归纳假设,但经过一些尝试后情况似乎并非如此。顺便说一句,我假设 forall (n m : nat).

那么induction n, minduction n. induction minduction n; induction m有什么区别呢?

这是我目前的理解:

我知道 ; 是一个组合器,因此 a; b 会在 a 生成的每个子目标上重放 b,因此 induction n; induction m 会生成一个归纳induction n 的每个子目标的 m 的假设对吗?

并且在同样的意义上induction n. induction m只会为当前目标生成归纳假设,所以这似乎不是特别有用

我预计 induction n, m 会像 对这两个变量进行归纳 这会像我预期的那样为自然数生成四个目标,但我预计 IHm在第 4 个目标的背景下,但事实并非如此!我错过了什么?

--

还在研究这个问题,好像IHm在第4个目标合并到IHn里了,对吗?

-- 编辑 2

这是一些基于加法交换律的例子

所以首先是 induction n, m 版本:

Example add_comm' : forall (n m : nat), n + m = m + n.
  intros. induction n, m; try auto using plus_n_O.

这解决了琐碎的 3 个第一个目标,并给我留下了第 4 个目标

n, m : nat
IHn : n + S m = S m + n

========================= (1 / 1)

S n + S m = S m + S n

现在 induction n; induction m 版本:

n, m : nat
IHn : n + S m = S m + n
IHm : n + m = m + n -> S n + m = m + S n

========================= (1 / 1)

S (n + S m) = S (m + S n)

所以对于这个特殊情况 induction n, m 更好,但我无法解释(和理解)它在做什么。

在手册中,归纳中 , 的唯一情况是

Variant induction term+, using qualid

This syntax is used for the case qualid denotes an induction principle with complex predicates as the induction principles generated by Function or Functional Scheme may be.

但我没有使用 using qualid 所以我不确定是否是这种情况

-- 编辑 3 --

正如 Andrey 在其评论中所说,using qualid 变体是被触发的变体,但我不知道对其作用的解释是什么。

induction n, m 等同于 induction n; destruct m。这样做的原因是,您实际上需要两个归纳假设的情况很少见,并且在您这样做的情况下,您可能不想要 induction n; induction m,因为 m 的归纳假设不会适当地通用超过 n.

8.15 的参考手册将比 8.14 的参考手册完整得多,您可以在 the current documentation for the master branch:

中找到它

If no induction_principle clause is provided, this is equivalent to doing induction on the first induction_clause followed by destruct on any subsequent clauses.