| ∀ 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
∀ 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, n0 + # y = 0
Used simplifier rules: lastN-zero: ⊦ lastn(0, x) = [];% ⊦ m + n = 0 ↔ m = 0 ∧ n = 0; (ws)% ⊦ # x = 0 ↔ x = []; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%c: ⊦ m + n = n + m; from specification nat-basic% ⊦ # [] = 0; (s)% ⊦ x + [] = x; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ [] + x = x; (s) Used terms: x + y, n0 + # y