[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 lastN-ex (conclusion) (back to tree)

n ≤ # x ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = # x - n

Heuristic elimination applied rule apply elim lemma

And obtained the following new goals

Rule argument

spec: nat, name:elim-sub, seq:n ≤ m ⊦ n0 = m - n ↔ m = n0 + n, subst:[m, n, n0] → [# x, n, n0]

Additional information

Used simplifier rules: n ≤ m ⊦ n0 = m - n ↔ m = n0 + n; (elim) Used terms: # x, n, n0

Proof step 2 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, n ≤ # x ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

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 3 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

User applied rule apply lemma

And obtained the following new goals

Rule argument

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

Additional information

Used terms: # x - n, x

Proof step 4 from proof lastN-ex (previous step) (back to tree)

⊦ n < # x ↔ x = firstn(n, x) + restn(n, x) ∧ n < # x

Lemma firstrestex

Proof step 5 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, # x - n < # x ↔ x = firstn(# x - n, x) + restn(# x - n, x) ∧ # x - n < # x ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

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 + n - m = n; (s) ⊦ m < m + n ↔ n ≠ 0; (s) n0 ≤ n ⊦ n - n0 < m ↔ n < m + n0; (s) ⊦ ¬ m + n < m; (s) ⊦ m ≤ n ↔ ¬ n < m; (ss)

Proof step 6 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, n ≠ 0 → x = firstn(n0, x) + restn(n0, x) ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

User applied rule cut formula

And obtained the following new goals

Rule argument

fma: n = 0

Additional information

Used simplifier rules: lastN-zero: ⊦ lastn(0, x) = []; ⊦ n + 0 = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ x + [] = x; (s) a: ⊦ (x + y) + z = x + y + z; from specification list Used formulas: n = 0

Proof step 7 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, n ≠ 0, n ≠ 0 → x = firstn(n0, x) + restn(n0, x) ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 8 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, x = firstn(n0, x) + restn(n0, x), n ≠ 0 ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0

User applied rule exists right

And obtained the following new goals

Rule argument

pos: right 1 terms: firstn(n0, x) abort: F discard: F computed: F

Additional information

Used terms: firstn(n0, x)

Proof step 9 from proof lastN-ex (previous step) (back to tree)

# x = n0 + n, x = firstn(n0, x) + restn(n0, x), n ≠ 0 ⊦ ∃ y. x = y + lastn(n, x) ∧ # y = n0, x = firstn(n0, x) + lastn(n, x) ∧ # firstn(n0, x) = n0

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:lastn-restn-01, seq:n ≤ # x ⊦ lastn(n, x) = restn(# x - n, x), subst:[x, n] → [x, n], <all paths>

Additional information

Used simplifier rules: first-length: ⊦ # firstn(n, x) = n; first-length: ⊦ # firstn(n, x) = n; ⊦ m + n - m = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ 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) Used terms: x, n

Proof step 10 from proof lastN-ex (previous step) (back to tree)

n ≤ # x ⊦ lastn(n, x) = restn(# x - n, x)

Lemma lastn-restn-01

Proof Tree for lastN-ex (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