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