[引理] 深度小于大小

对 [定义] 项的集合 中的所有有限项 𝑡,采用 [定义] 大小与深度 的函数定义,有 depth( 𝑡 )<size( 𝑡 )。

证明

按 [定理] 结构归纳原理(structural induction) 对 𝑡 进行结构归纳。

  • 𝑡 是常量:depth( 𝑡 )=0<1=size( 𝑡 )。
  • 𝑡= succ 𝑡 1(pred、iszero 完全相同): 归纳假设 是 depth( 𝑡 1 )<size( 𝑡 1 ),两边加一即得 depth( 𝑡 )<size( 𝑡 )。
  • 𝑡= if 𝑡 1 then 𝑡 2 else 𝑡 3:设 𝑡 𝑖 是三个子项中深度最大的那个。由 归纳假设 ,

    depth( 𝑡 )=depth( 𝑡 𝑖 )+1<size( 𝑡 𝑖 )+1≤size( 𝑡 1 )+size( 𝑡 2 )+size( 𝑡 3 )+1=size( 𝑡 )

    其中 ≤ 用到了每个子项的大小都至少为 1。
∎

References

[定理] 结构归纳原理(structural induction) [structural-induction]

[定义] 归纳假设 [induction-hypothesis]

[定义] 大小与深度 [size-and-depth]

[定义] 项的集合 [set-of-terms]

Based on Typsite