[Imprint][Data Privacy Statement][E-Mail]



View long theorem info. View the proof. Back to main index. View the specification. View theorem base summary, View theorem base listing, the used properties by spec, the dependency list, the symbol table,

Proof step 1 from proof put-firstn-restn (conclusion) (back to tree)

⊦ n < # x → x[n := a] = firstn(n, x) + a ' + restn(n + 1, x)

System applied rule normalize

And obtained the following new goals

Rule argument

Additional information

Proof step 2 from proof put-firstn-restn (previous step) (back to tree)

x[n := a] ≠ firstn(n, x) + a ' + restn(n + 1, x), n < # x ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: restN-rec: ⊦ restn(n + 1, x) = restn(n, x.tail); ⊦ # x = 0 ↔ x = []; (s) f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic a: ⊦ (x + y) + z = x + y + z; from specification list c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic

Proof step 3 from proof put-firstn-restn (previous step) (back to tree)

x[n := a] ≠ firstn(n, x) + a ' + restn(n, x.tail), x ≠ [], n < # x ⊦

Heuristic elimination applied rule apply elim lemma

And obtained the following new goals

Rule argument

spec: list-data, name:elim-list-c, seq:x ≠ [] ⊦ a = x.head ∧ y = x.tail ↔ x = a + y, subst:[x, a, y] → [x, a0, y]

Additional information

Used simplifier rules: x ≠ [] ⊦ a = x.head ∧ y = x.tail ↔ x = a + y; (elim) Used terms: x, a0, y

Proof step 4 from proof put-firstn-restn (previous step) (back to tree)

x = a0 + y, x[n := a] ≠ firstn(n, x) + a ' + restn(n, y), x ≠ [], n < # x ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ m < n ↔ ¬ n ≤ m; (ss) c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ m < n + 1 ↔ ¬ n < m; (s) a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ m +1 = m + 1; (s) ⊦ #(a ' + x) = (# x)+1; (s) ⊦ a + x = a ' + x; (s) ⊦ a ' ≠ []; (s) ⊦ x + y = [] ↔ x = [] ∧ y = []; (s)

Proof step 5 from proof put-firstn-restn (previous step) (back to tree)

(a0 ' + y)[n := a] ≠ firstn(n, a0 ' + y) + a ' + restn(n, y), n ≤ # y ⊦

Heuristic elimination applied rule apply elim lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:elim-firstn-restn, seq: ⊦ n ≤ # x → (y = firstn(n, x) ∧ z = restn(n, x) ↔ x = y + z ∧ # y = n), subst:[x, n, y, z] → [y, n, y0, z]

Additional information

Used terms: y, n, y0, z

Proof step 6 from proof put-firstn-restn (previous step) (back to tree)

⊦ n ≤ # x → (y = firstn(n, x) ∧ z = restn(n, x) ↔ x = y + z ∧ # y = n)

Lemma elim-firstn-restn

Proof step 7 from proof put-firstn-restn (previous step) (back to tree)

# y0 = n, y = y0 + z, (a0 ' + y)[n := a] ≠ firstn(n, a0 ' + y) + a ' + z, n ≤ # y ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ m ≤ m + n; (s) a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ #(x + y) = # x + # y; (s)

Proof step 8 from proof put-firstn-restn (previous step) (back to tree)

(a0 ' + y0 + z)[# y0 := a] ≠ firstn(# y0, a0 ' + y0 + z) + a ' + z ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:firstN-rec-01, seq: ⊦ n ≠ 0 → firstn(n, a ' + x) = a ' + firstn(n -1, x), subst:[x, a, n] → [y0 + z, a0, # y0], <all paths>

Additional information

Used simplifier rules: put-zero: ⊦ (b ' + x)[0 := a] = a + x; firstN-zero: ⊦ firstn(0, x) = []; ⊦ # x = 0 ↔ x = []; (s) ⊦ a + x = a ' + x; (s) ⊦ # [] = 0; (s) ⊦ [] + x = x; (s) ⊦ # x = # z → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws) a: ⊦ (x + y) + z = x + y + z; from specification list Used terms: y0 + z, a0, # y0

Proof step 9 from proof put-firstn-restn (previous step) (back to tree)

⊦ n ≠ 0 → firstn(n, a ' + x) = a ' + firstn(n -1, x)

Lemma firstN-rec-01

Proof step 10 from proof put-firstn-restn (previous step) (back to tree)

# y0 ≠ 0, (a0 ' + y0 + z)[# y0 := a] ≠ (a0 ' + firstn((# y0)-1, y0 + z)) + a ' + z ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ n -1 = n - 1; (s) ⊦ # x = 0 ↔ x = []; (s)

Proof step 11 from proof put-firstn-restn (previous step) (back to tree)

(a0 ' + y0 + z)[# y0 := a] ≠ a0 ' + firstn(# y0 - 1, y0 + z) + a ' + z, y0 ≠ [] ⊦

Heuristic elimination applied rule apply elim lemma

And obtained the following new goals

Rule argument

spec: nat, name:elim-pred-c, seq:n ≠ 0 ⊦ m = n - 1 ↔ n = m + 1, subst:[n, m] → [# y0, m]

Additional information

Used simplifier rules: ⊦ # x = 0 ↔ x = []; (s) n ≠ 0 ⊦ m = n - 1 ↔ n = m + 1; (elim) Used terms: # y0, m

Proof step 12 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, # y0 ≠ 0, (a0 ' + y0 + z)[# y0 := a] ≠ a0 ' + firstn(m, y0 + z) + a ' + z, y0 ≠ [] ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: put-succ: ⊦ (b ' + x)[n + 1 := a] = b + x[n := a]; a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ # x = # z → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws) 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) ⊦ # x = 0 ↔ x = []; (s)

Proof step 13 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, (y0 + z)[m := a] ≠ firstn(m, y0 + z) + a ' + z, y0 ≠ [] ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:first-append, seq: ⊦ m ≤ # x → firstn(m, x + y) = firstn(m, x), subst:[y, x, m] → [z, y0, m], <all paths>

Additional information

Used simplifier rules: ⊦ m ≤ n ↔ ¬ n < m; (ss) f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic lf-02: ⊦ m < n ∧ m = n0 → n0 < n; (forward) from specification nat-basic ⊦ m < n → n ≠ 0; (s) ⊦ ¬ m + n < m; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic Used terms: z, y0, m

Proof step 14 from proof put-firstn-restn (previous step) (back to tree)

⊦ m ≤ # x → firstn(m, x + y) = firstn(m, x)

Lemma first-append

Proof step 15 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, (y0 + z)[m := a] ≠ firstn(m, y0) + a ' + z, y0 ≠ [], m ≤ # y0 ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ m ≤ m + n; (s)

Proof step 16 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, (y0 + z)[m := a] ≠ firstn(m, y0) + a ' + z, y0 ≠ [] ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:put-app-left, seq: ⊦ n < # x → (x + y)[n := a] = x[n := a] + y, subst:[a, n, y, x] → [a, m, z, y0], <all paths>

Additional information

Used simplifier rules: ⊦ m < n ↔ ¬ n ≤ m; (ss) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ m = n + 1 → ¬ m ≤ n; (s) Used terms: a, m, z, y0

Proof step 17 from proof put-firstn-restn (previous step) (back to tree)

⊦ n < # x → (x + y)[n := a] = x[n := a] + y

Lemma put-app-left

Proof step 18 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, y0[m := a] + z ≠ firstn(m, y0) + a ' + z, y0 ≠ [], m < # y0 ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ ¬ n < n; (s) ⊦ m < n + 1 ↔ ¬ n < m; (s) ⊦ m < n → (n ≤ m + 1 ↔ n = m + 1); (s) ⊦ m + 1 ≠ 0; (s) lf-01: ⊦ m < n ∧ n = n0 → m < n0; (forward) from specification nat-basic f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic eqle-one: ⊦ m = n + 1 ∧ n < n0 → m ≤ n0; (forward) from specification nat a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ # y = # y0 → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws)

Proof step 19 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, y0[m := a] ≠ firstn(m, y0) + a ', y0 ≠ [] ⊦

User applied rule cut formula

And obtained the following new goals

Rule argument

fma: y0 = y0.butlast + y0.last '

Additional information

Used simplifier rules: x ≠ [] ⊦ x.butlast + x.last ' = x; (s) a: ⊦ (x + y) + z = x + y + z; from specification list Used formulas: y0 = y0.butlast + y0.last '

Proof step 20 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, y0 = y0.butlast + y0.last ', y0[m := a] ≠ firstn(m, y0) + a ', y0 ≠ [] ⊦

User applied rule subst equation

And obtained the following new goals

Rule argument

pos: left 2, flags:

Additional information

Proof step 21 from proof put-firstn-restn (previous step) (back to tree)

#(y0.butlast + y0.last ') = m + 1, y0 = y0.butlast + y0.last ', y0.butlast + y0.last ' ≠ [], (y0.butlast + y0.last ')[m := a] ≠ firstn(m, y0.butlast + y0.last ') + a ' ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:put-app-right, seq: ⊦ # x ≤ n → (x + y)[n := a] = x + y[n - # x := a], subst:[a, n, y, x] → [a, m, y0.last ', y0.butlast], <all paths>

Additional information

Used simplifier rules: put-last: ⊦ n = # x → (x + a ')[n := b] = x + b '; firstN-len: ⊦ firstn(# x, x + y) = x; ⊦ ¬ n < n; (s) x ≠ [] ⊦ x.butlast + x.last ' = x; (s) ⊦ #(x + y) = # x + # y; (s) ⊦ # a ' = 0 +1; (s) ⊦ m + n = m + n0 ↔ n = n0; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ x + y = [] ↔ x = [] ∧ y = []; (s) ⊦ a ' ≠ []; (s) ⊦ # y = # y0 → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws) ⊦ m ≤ n ↔ ¬ n < m; (ss) f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic lf-02: ⊦ m < n ∧ m = n0 → n0 < n; (forward) from specification nat-basic lf-01: ⊦ m < n ∧ n = n0 → m < n0; (forward) from specification nat-basic ⊦ # x = 0 ↔ x = []; (s) a: ⊦ (x + y) + z = x + y + z; from specification list Used terms: a, m, y0.last ', y0.butlast

Proof step 22 from proof put-firstn-restn (previous step) (back to tree)

⊦ # x ≤ n → (x + y)[n := a] = x + y[n - # x := a]

Lemma put-app-right

Proof step 23 from proof put-firstn-restn (previous step) (back to tree)

#(y0.butlast + y0.last ') = m + 1, y0 = y0.butlast + y0.last ', y0.butlast + y0.last ' ≠ [], y0.butlast + y0.last '[m - # y0.butlast := a] ≠ firstn(m, y0.butlast + y0.last ') + a ', # y0.butlast ≤ m ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:first-append, seq: ⊦ m ≤ # x → firstn(m, x + y) = firstn(m, x), subst:[y, x, m] → [y0.last ', y0.butlast, m], <all paths>

Additional information

Used simplifier rules: ⊦ x + y = [] ↔ x = [] ∧ y = []; (s) ⊦ a ' ≠ []; (s) ⊦ m ≤ n → (n ≤ m ↔ m = n); (s) x ≠ [] ⊦ x.butlast + x.last ' = x; (s) ⊦ #(x + y) = # x + # y; (s) ⊦ # a ' = 0 +1; (s) a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ m + n = m + n0 ↔ n = n0; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic Used terms: y0.last ', y0.butlast, m

Proof step 24 from proof put-firstn-restn (previous step) (back to tree)

⊦ m ≤ # x → firstn(m, x + y) = firstn(m, x)

Lemma first-append

Proof step 25 from proof put-firstn-restn (previous step) (back to tree)

#(y0.butlast + y0.last ') = m + 1, y0 = y0.butlast + y0.last ', y0.butlast + y0.last ' ≠ [], y0.butlast + y0.last '[m - # y0.butlast := a] ≠ firstn(m, y0.butlast) + a ', # y0.butlast ≤ m, m ≤ # y0.butlast ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: put-one: ⊦ a '[0 := b] = b '; c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ ¬ n < n; (s) ⊦ m < n + 1 ↔ ¬ n < m; (s) a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ # y = # y0 → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws) ⊦ m - m = 0; (s) ⊦ n + 0 = n; (s) ⊦ n ≤ m → m + n0 - n = (m - n) + n0; (s) ⊦ m < n → (n ≤ m + 1 ↔ n = m + 1); (s) n0 ≤ n ⊦ n - n0 ≤ m ↔ n ≤ m + n0; (s) ⊦ ¬ m < n → ¬ m + m0 < n; (s) ⊦ m ≤ n ↔ ¬ n < m; (ss) ⊦ x ≠ [] → # x.butlast = # x - 1; (s) ⊦ m + 1 ≤ n ↔ m < n; (s) n0 ≤ n ⊦ m ≤ n - n0 ↔ m + n0 ≤ n; (s) x ≠ [] ⊦ x.butlast + x.last ' = x; (s) ⊦ m + n = 0 ↔ m = 0 ∧ n = 0; (ws) ⊦ # [] = 0; (s)

Proof step 26 from proof put-firstn-restn (previous step) (back to tree)

# y0 = m + 1, y0.butlast ≠ firstn(m, y0.butlast), y0 ≠ [] ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:first-all-01, seq: ⊦ # x = n → firstn(n, x) = x, subst:[x, n] → [y0.butlast, m], <all paths>

Additional information

Used simplifier rules: ⊦ x ≠ [] → # x.butlast = # x - 1; (s) ⊦ n ≤ m → m + n0 - n = (m - n) + n0; (s) ⊦ n + 0 = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic Used terms: y0.butlast, m

Proof step 27 from proof put-firstn-restn (previous step) (back to tree)

⊦ # x = n → firstn(n, x) = x

Lemma first-all-01

Proof Tree for put-firstn-restn (View conclusion)

The following image shows the proof tree of sequent calculus. The proved goal is at the bottom. You can click on the nodes to view additional rules. See here for details on colors in a proof tree.

the proof tree