| n < m0 +1, n ≤ # x0, m0 +1 ≤ 1 + # x0, ∀ n, x0, a. n < m0 ∧ n ≤ # x0 ∧ m0 ≤ 1 + # x0 ∧ (∀ n0, m0. n0 < m0 ∧ n0 < # x0 ∧ m0 ≤ # x0 → firstn(m0, x0)[n0] = x0[n0]) → firstn(m0, a ' + x0)[n] = (a ' + x0)[n] ∨ x0 = [], ∀ n0, m0. n0 < m0 ∧ n0 < # x0 ∧ m0 ≤ # x0 → firstn(m0, x0)[n0] = x0[n0] ⊦ firstn(m0 +1, a ' + x0).tail[n - 1] = (a ' + x0)[n], firstn(m0 +1, a ' + x0) = [], n = 0, x0 = [] |
m0 ≤ # x0, n ≤ m0, n ≤ # x0, ∀ n0, m0. n0 < m0 ∧ n0 < # x0 ∧ m0 ≤ # x0 → firstn(m0, x0)[n0] = x0[n0], ∀ n, x0, a. n < m0 ∧ n ≤ # x0 ∧ m0 ≤ 1 + # x0 ∧ (∀ n0, m0. n0 < m0 ∧ n0 < # x0 ∧ m0 ≤ # x0 → firstn(m0, x0)[n0] = x0[n0]) → firstn(m0, a ' + x0)[n] = (a ' + x0)[n] ∨ x0 = [] ⊦ firstn(m0, x0)[n - 1] = (a ' + x0)[n], n = 0, x0 = []
Used simplifier rules: firstN-rec: ⊦ firstn(n + 1, x) = x.head + firstn(n, x.tail);%let: ⊦ n ≤ n0 ∧ n0 ≤ n1 → n ≤ n1; (forward) from specification nat% ⊦ m < n ↔ ¬ n ≤ m; (ss)% ⊦ m < n + 1 ↔ ¬ n < m; (s)% ⊦ m + n ≤ m + n0 ↔ n ≤ n0; (s)% ⊦ a ' + x ≠ []; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ a + x = a ' + x; (s)% ⊦ (a ' + x).tail = x; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ (a ' + x).head = a; (s)% ⊦ m +1 = m + 1; (s)