| # x0 = n0 + # z, a0 ' + x0 = firstn(n0, a0 ' + x0) + a ' + z, # z ≤ # x0, x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → firstn(n0, x0).butlast = firstn(# x0 - 1 + # z, x0), a0 ∈ firstn(n0, a0 ' + x0) ∨ a0 = a ∨ a0 ∈ z ⊦ (a0 ' + firstn(n0, x0)).butlast = firstn(n0, a0 ' + x0) |
⊦ n ≠ 0 → firstn(n, a ' + x) = a ' + firstn(n -1, x)
n0 ≠ 0, # x0 = n0 + # z, a0 ' + x0 = (a0 ' + firstn(n0 -1, x0)) + a ' + z, # z ≤ # x0, x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → firstn(n0, x0).butlast = firstn(# x0 - 1 + # z, x0), a0 ∈ a0 ' + firstn(n0 -1, x0) ∨ a0 = a ∨ a0 ∈ z ⊦ (a0 ' + firstn(n0, x0)).butlast = a0 ' + firstn(n0 -1, x0)
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%app: ⊦ x + [] = x; from specification list%b: ⊦ a '.butlast = []; from specification list-last Used terms: x0, a0, n0