| less#(a, x0) + violations(x0) = m + 1, x0 = a0 + y, a0 < a, ∀ m0, n0. violations(x0) = m0 + 1 ∧ x0[n0 + 1] < x0[n0] ∧ n0 + 1 < # x0 → violations(x0[n0, x0[n0 + 1]][n0 + 1, x0[n0]]) = m0 ⊦ violations((a0 ' + x0)[1, a]) = m, x0 = [] |
a0 < a, ∀ m0, n. less#(a0, y) + violations(y) = m0 + 1 ∧ y[n] < (a0 ' + y)[n] ∧ n < # y → violations((a0 ' + y)[n, y[n]][n + 1, (a0 ' + y)[n]]) = m0 ⊦ violations((a0 ' + a0 ' + y)[1, a]) = less#(a, y) + less#(a0, y) + violations(y)
Used simplifier rules: less-rec: ⊦ less#(a, b ' + x) = (b < a ⊃ 1;0) + less#(a, x);%violations-rec: ⊦ violations(a ' + x) = less#(a, x) + violations(x);% ⊦ m + n < m + n0 ↔ n < n0; (s)% ⊦ m +1 = m + 1; (s)% ⊦ #(a ' + x) = (# x)+1; (s)% ⊦ (a ' + x)[n + 1] = x[n]; (s)% ⊦ a ' + x ≠ []; (s)%c: ⊦ m + n = n + m; from specification nat-basic% ⊦ m + n = m + n0 ↔ n = n0; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ a + x = a ' + x; (s)