| ∀ y0, n0, x. # y0 < # y → true → lastn(n0 + # y0, x + y0) = lastn(n0, x) + y0 ⊦ lastn(n0 + # y, x + y) = lastn(n0, x) + y |
⊦ n ≠ 0 → lastn(n, x) = lastn(n -1, x.butlast) + x.last
n0 + # y ≠ 0, ∀ y0, n0, x. # y0 < # y → true → lastn(n0 + # y0, x + y0) = lastn(n0, x) + y0 ⊦ lastn((n0 + # y)-1, (x + y).butlast) + (x + y).last = lastn(n0, x) + y
Used simplifier rules: lastN-zero: ⊦ lastn(0, x) = [];%z-01: ⊦ m + n = 0 ↔ m = 0 ∧ n = 0; from specification nat-basic2%l: ⊦ # x = 0 ↔ x = []; from specification list-data%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic2%c: ⊦ m + n = n + m; from specification nat-basic2%size-01: ⊦ # [] = 0; from specification list-data%app: ⊦ x + [] = x; from specification list%a: ⊦ (x + y) + z = x + y + z; from specification list%Nil: ⊦ [] + x = x; from specification list Used terms: x + y, n0 + # y