| # x0 = n1 + # z, a0 ' + x0 = firstn(n1, a0 ' + x0) + a ' + z, # z ≤ # x0, ∀ z, a. x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → x0 = firstn(# x0 - # z, x0) + z, a0 ∈ firstn(n1, a0 ' + x0) ∨ a0 = a ∨ a0 ∈ z ⊦ x0 = firstn(n1, x0) + z |
⊦ n ≠ 0 → firstn(n, a ' + x) = a ' + firstn(n -1, x)
n1 ≠ 0, # x0 = n1 + # z, a0 ' + x0 = (a0 ' + firstn(n1 -1, x0)) + a ' + z, # z ≤ # x0, ∀ z, a. x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → x0 = firstn(# x0 - # z, x0) + z, a0 ∈ a0 ' + firstn(n1 -1, x0) ∨ a0 = a ∨ a0 ∈ z ⊦ x0 = firstn(n1, x0) + z
Used simplifier rules: firstN-zero: ⊦ firstn(0, x) = [];%add-base: ⊦ n + 0 = n; from specification nat-basic2%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic2%c: ⊦ m + n = n + m; from specification nat-basic2%Nil: ⊦ [] + x = x; from specification list%a: ⊦ (x + y) + z = x + y + z; from specification list%len-06: ⊦ # y = # y0 → (x + y = z + y0 ↔ x = z ∧ y = y0); from specification list%c-04: ⊦ a ' = b ' ↔ a = b; from specification list Used terms: x0, a0, n1