[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 diag-theorem-butlast (conclusion) (back to tree)

∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n) + 1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1))

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)

Proof step 2 from proof diag-theorem-butlast (previous step) (back to tree)

∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

User applied rule apply lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:nextl-lemma-butlast-nonempty, seq:∀ n, a. nextl(n, a) ≠ [] ⊦ ∃ lf. lf(0) = a ' ∧ (∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ []), subst:[nextl, a] → [nextl, a]

Additional information

Used terms: nextl, a

Proof step 3 from proof diag-theorem-butlast (previous step) (back to tree)

∀ n, a. nextl(n, a) ≠ [] ⊦ ∃ lf. lf(0) = a ' ∧ (∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [])

Lemma nextl-lemma-butlast-nonempty

Proof step 4 from proof diag-theorem-butlast (previous step) (back to tree)

∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∀ n, a. nextl(n, a) ≠ [], ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 5 from proof diag-theorem-butlast (previous step) (back to tree)

nextl(n, a0) = [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

Heuristic quantifier closing applied rule all left

And closed the goal!

Rule argument

pos: left 2 terms: n, a0

Additional information

Used terms: n, a0

Proof step 6 from proof diag-theorem-butlast (previous step) (back to tree)

∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∃ lf. lf(0) = a ' ∧ (∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ []) ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 7 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

User applied rule apply lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:infinite-append-butlast, seq:∀ n. lf(n).last = lf(n + 1).head ∧ lf(n) ≠ [] ⊦ ∃ σ, ii. ii(0) = 0 ∧ (∀ n. ii(n + 1) = ii(n) + # lf(n) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n) = ⌜lf(n)⌝ ) ∧ (∀ m, n. m ≤ n → ii(m) ≤ ii(n)) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n) + 1⌝ ∧ (∀ m. n ≤ m → lf(m).tail = [] ∧ ii(m) = ii(n)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) ), subst:[lf] → [λ n. lf(n + 1)]

Additional information

Used terms: λ n. lf(n + 1)

Proof step 8 from proof diag-theorem-butlast (previous step) (back to tree)

∀ n. lf(n).last = lf(n + 1).head ∧ lf(n) ≠ [] ⊦ ∃ σ, ii. ii(0) = 0 ∧ (∀ n. ii(n + 1) = ii(n) + # lf(n) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n) = ⌜lf(n)⌝ ) ∧ (∀ m, n. m ≤ n → ii(m) ≤ ii(n)) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n) + 1⌝ ∧ (∀ m. n ≤ m → lf(m).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1))

Lemma infinite-append-butlast

Proof step 9 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [] ⊦ ∀ n. lf(n + 1).last = lf((n + 1) + 1).head ∧ lf(n + 1) ≠ [], ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

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

Proof step 10 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) ), lf(n + 1).last = lf(2 + n).head ∧ lf(n + 1) ≠ []

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 2 terms: n + 1 abort: F discard: F computed: F

Additional information

Used terms: n + 1

Proof step 11 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', lf((n + 1) + 1) = nextl(n + 1, lf(n + 1).last), lf(n + 1) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [] ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) ), lf(n + 1).last = lf(2 + n).head ∧ lf(n + 1) ≠ []

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

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

Proof step 12 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', lf(2 + n) = nextl(n + 1, lf(n + 1).last), lf(n + 1).last ≠ lf(2 + n).head, lf(n + 1) ≠ [], ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

User applied rule all left

And closed the goal!

Rule argument

pos: left 6 terms: n + 1, lf(n + 1).last abort: F discard: F computed: T

Additional information

Used terms: n + 1, lf(n + 1).last

Proof step 13 from proof diag-theorem-butlast (previous step) (back to tree)

lf(0) = a ', ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∃ σ, ii. ii(0) = 0 ∧ (∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ) ∧ (∀ m, n. m ≤ n → ii(m) ≤ ii(n)) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n) + 1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)) ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

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)

Proof step 14 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, lf(0) = a ', (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ σ, ii. ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m)) ;∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1) )

User applied rule exists right

And obtained the following new goals

Rule argument

pos: right 1 terms: σ, ii abort: F discard: T computed: T

Additional information

Used terms: σ, ii

Proof step 15 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, lf(0) = a ', (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ ii(0) = 0 ∧ σ[0] = a ∧ σ ≠ [] ∧ (∀ n. ii(n + 1) = ii(n) + # nextl(n, σ[ii(n)]) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # nextl(n, σ[ii(n)]) = ⌜nextl(n, σ[ii(n)])⌝ ) ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 16 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, lf(0) = a ', (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ σ[0] = a ∧ σ ≠ [] ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ ⌜ii(n0 + 1)⌝ < # σ ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1))

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 4 terms: 0 abort: F discard: F computed: F

Additional information

Used terms: 0

Proof step 17 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, ii(0 + 1) = ii(0) + # lf(0 + 1) - 1, lf(0) = a ', (σ from ii(0)) to # lf(0 + 1) = ⌜lf(0 + 1)⌝ , ⌜ii(0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ σ[0] = a ∧ σ ≠ [] ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ ⌜ii(n0 + 1)⌝ < # σ ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ ¬ n < 0; (s) ⊦ ⌜m⌝ < ⌜n⌝ ↔ m < n; (s) ⊦ # [] = ⌜0⌝ ; (s) ⊦ σ from 0 = σ; (s) c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ n + 0 = n; (s)

Proof step 18 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, ii(1) = # lf(1) - 1, lf(0) = a ', σ to # lf(1) = ⌜lf(1)⌝ , σ ≠ [], ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ⌜ii(n0 + 1)⌝ < # σ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 9 terms: n0 abort: F discard: F computed: F

Additional information

Used terms: n0

Proof step 19 from proof diag-theorem-butlast (previous step) (back to tree)

ii(1) = # lf(1) - 1, ii(0) = 0, lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), σ to # lf(1) = ⌜lf(1)⌝ , lf(n0) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ⌜ii(n0 + 1)⌝ < # σ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 10 terms: n0 abort: F discard: F computed: F

Additional information

Used terms: n0

Proof step 20 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, ii(1) = # lf(1) - 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', σ to # lf(1) = ⌜lf(1)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ⌜ii(n0 + 1)⌝ < # σ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 21 from proof diag-theorem-butlast (previous step) (back to tree)

ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(1) = # lf(1) - 1, ii(0) = 0, lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to # lf(1) = ⌜lf(1)⌝ , lf(n0) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 15 terms: 0 abort: F discard: F computed: F

Additional information

Used terms: 0

Proof step 22 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, ii(1) = # lf(1) - 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(0 + 1) = nextl(0, lf(0).last), σ to # lf(1) = ⌜lf(1)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(0) ≠ [], lf(n0) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ a ' ≠ []; (s) ⊦ a '.last = a; (s) c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic

Proof step 23 from proof diag-theorem-butlast (previous step) (back to tree)

ii(0) = 0, ii(1) = # nextl(0, a) - 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), σ to # nextl(0, a) = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 14 terms: 0, a abort: F discard: F computed: T

Additional information

Used terms: 0, a

Proof step 24 from proof diag-theorem-butlast (previous step) (back to tree)

nextl(0, a).head = a, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(1) = # nextl(0, a) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to # nextl(0, a) = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 25 from proof diag-theorem-butlast (previous step) (back to tree)

nextl(0, a).head = a, ii(0) = 0, ii(1) = # nextl(0, a) - 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), σ to # nextl(0, a) = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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] → [# nextl(0, a), m0]

Additional information

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

Proof step 26 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = m0 + 1, nextl(0, a).head = a, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(1) = m0, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to # nextl(0, a) = ⌜nextl(0, a)⌝ , # nextl(0, a) ≠ 0, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ # x = 0 ↔ x = []; (s)

Proof step 27 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, nextl(0, a).head = a, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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] → [nextl(0, a), a0, x0]

Additional information

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

Proof step 28 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, a0 = a, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a0 + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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 in-14: ⊦ a ' + x = y → a ∈ y; (forward) from specification list ⊦ a + x = a ' + x; (s)

Proof step 29 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule cut formula

And obtained the following new goals

Rule argument

fma: ∀ n. σ[ii(n)] = lf(n).last

Additional information

Used formulas: ∀ n. σ[ii(n)] = lf(n).last

Proof step 30 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. σ[ii(n)] = lf(n).last ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 17 terms: n0 abort: F discard: F computed: F

Additional information

Used terms: n0

Proof step 31 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. σ[ii(n)] = lf(n).last, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 32 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. σ[ii(n)] = lf(n).last ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule case distinction

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Proof step 33 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. σ[ii(n)] = lf(n).last, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1))

User applied rule case distinction

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Proof step 34 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, finp(σ), a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. σ[ii(n)] = lf(n).last ⊦ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ ⌜x⌝ [n] = x[n]; (s) add-comm: ⊦ n∞1 + n∞2 = n∞2 + n∞1; from specification nat-inf add-assoc: ⊦ (n∞ + n∞1) + n∞2 = n∞ + n∞1 + n∞2; from specification nat-inf ⊦ ⌜n⌝ + ⌜m⌝ = ⌜n0⌝ ↔ n + m = n0; (s) ⊦ # ⌜x⌝ = ⌜# x⌝ ; (s) ⊦ ⌜x⌝ = ⌜x0⌝ ↔ x = x0; (s) ⊦ ⌜x⌝ to n = ⌜x to n⌝ ; (s) ⊦ ⌜x⌝ from n = ⌜x from n⌝ ; (s) ⊦ finp(⌜x⌝ ); (s) ⊦ ⌜x⌝ = [] ↔ x = []; (s) stream-fin-forward: ⊦ finp(σ) → (∃ x. ⌜x⌝ = σ); (forward) from specification stream-basic 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) ⊦ n∞ = ⌜m⌝ + ⌜n0⌝ → (⌜n⌝ < n∞ ↔ n < m + n0); (s) ⊦ m < n ↔ ¬ n ≤ m; (ss)

Proof step 35 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, x to ii(1) + 1 = nextl(0, a), (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(1) ≤ ii(n), ii(n0 + 1) ≤ ii(n), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ n1. x[ii(n1)] = lf(n1).last, ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1) ⊦ ∃ n1. ii(n1) + 1 = # x ∧ (∀ m. n1 ≤ m → nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n1) = ii(m))

User applied rule exists right

And obtained the following new goals

Rule argument

pos: right 1 terms: n abort: F discard: T computed: T

Additional information

Used terms: n

Proof step 36 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ n1. x[ii(n1)] = lf(n1).last, ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ii(n) + 1 = # x ∧ (∀ m. n ≤ m → nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n) = ii(m))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 37 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, x to ii(1) + 1 = nextl(0, a), (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(1) ≤ ii(n), ii(n0 + 1) ≤ ii(n), n ≤ m, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ n1. x[ii(n1)] = lf(n1).last, ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1) ⊦ nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n) = ii(m)

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 19 terms: m abort: F discard: F computed: F

Additional information

Used terms: m

Proof step 38 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(m + 1) = nextl(m, lf(m).last), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(m) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ n1. x[ii(n1)] = lf(n1).last, ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n) = ii(m)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 39 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(m + 1) = nextl(m, lf(m).last), lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, x to ii(1) + 1 = nextl(0, a), (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(m) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(1) ≤ ii(n), ii(n0 + 1) ≤ ii(n), n ≤ m, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ n1. x[ii(n1)] = lf(n1).last, ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1) ⊦ nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n) = ii(m)

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 24 terms: m abort: F discard: T computed: F

Additional information

Used terms: m

Proof step 40 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, x[ii(m)] = lf(m).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(m + 1) = nextl(m, lf(m).last), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(m) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ nextl(m, x[ii(m)]) = x[ii(m)] ' ∧ ii(n) = ii(m)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 41 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, x[ii(m)] = lf(m).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(m + 1) = nextl(m, x[ii(m)]), lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, x to ii(1) + 1 = nextl(0, a), (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(m) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(1) ≤ ii(n), ii(n0 + 1) ≤ ii(n), n ≤ m, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1) ⊦ lf(m + 1) = x[ii(m)] ' ∧ ii(n) = ii(m)

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 24 terms: m abort: F discard: T computed: T

Additional information

Used terms: m

Proof step 42 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, x[ii(m)] = lf(m).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(m + 1) = nextl(m, x[ii(m)]), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(m) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ lf(m + 1) = x[ii(m)] ' ∧ ii(n) = ii(m)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 43 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, lf(m + 1).tail = [], x[ii(n)] = lf(m).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(m) = ii(n), lf(m + 1) = nextl(m, x[ii(n)]), lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, x to ii(1) + 1 = nextl(0, a), (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(m) ≠ [], lf(n0) ≠ [], lf(m + 1) ≠ x[ii(n)] ', nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), ii(1) ≤ ii(n), ii(n0 + 1) ≤ ii(n), n ≤ m, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1) ⊦

User applied rule apply elim lemma

And obtained the following new goals

Rule argument

spec: list-data, name:elim-1, seq: ⊦ x ≠ [] → (head = x.head ∧ tail = x.tail ↔ x = head + tail), subst:[x, head, tail] → [lf(m + 1), a0, x1]

Additional information

Used simplifier rules: ⊦ x ≠ [] → (head = x.head ∧ tail = x.tail ↔ x = head + tail); (elim) Used terms: lf(m + 1), head, tail

Proof step 44 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, lf(m + 1).tail = [], x[ii(n)] = lf(m).last, ii(m) = ii(n), ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(m + 1) = [], lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(m + 1) = nextl(m, x[ii(n)]), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(m) ≠ [], lf(n0) ≠ [], lf(m + 1) ≠ x[ii(n)] ', nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ a ' ≠ []; (s)

Proof step 45 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, [].tail = [], [] = nextl(m, x[ii(n)]), x[ii(n)] = lf(m).last, ii(m) = ii(n), ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(m + 1) = [], lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), lf(n0) ≠ [], lf(m) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦

Heuristic quantifier closing applied rule all left

And closed the goal!

Rule argument

pos: left 26 terms: m + 1

Additional information

Used terms: m + 1

Proof step 46 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n) + 1 = # x, x[ii(n)] = lf(m).last, ii(m) = ii(n), ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(m + 1) = nextl(m, x[ii(n)]), lf(m + 1) = a0 + x1, nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), x1 = [], lf(m + 1) ≠ [], lf(m) ≠ [], lf(n0) ≠ [], lf(m + 1) ≠ x[ii(n)] ', nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ a ' ≠ []; (s) ⊦ a ' = b ' ↔ a = b; (s) a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ x + [] = x; (s) ⊦ a + x = a ' + x; (s)

Proof step 47 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, a0 ' = nextl(m, x[ii(n)]), ii(n) + 1 = # x, x[ii(n)] = lf(m).last, ii(m) = ii(n), ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(m + 1) = a0 ', lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (x from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), x to ii(1) + 1 = nextl(0, a), a0 ≠ x[ii(n)], lf(n0) ≠ [], lf(m) ≠ [], nextl(0, a) ≠ [], x ≠ [], a ∈ nextl(0, a), n ≤ m, ii(n0 + 1) ≤ ii(n), ii(1) ≤ ii(n), ∀ n1. ii(n1 + 1) = ii(n1) + # lf(n1 + 1) - 1 ∧ ¬ ii(n) < ii(n1 + 1) ∧ (x from ii(n1)) to # lf(n1 + 1) = lf(n1 + 1), ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦

User applied rule all left

And closed the goal!

Rule argument

pos: left 27 terms: m, x[ii(n)] abort: F discard: F computed: T

Additional information

Used simplifier rules: ⊦ a '.head = a; (s) Used terms: m, x[ii(n)]

Proof step 48 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, a ∈ nextl(0, a), ¬ finp(σ), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. σ[ii(n)] = lf(n).last ⊦ ∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ ⌜x⌝ = ⌜x0⌝ ↔ x = x0; (s) ⊦ ⌜nf⌝ to n = ⌜nf to n⌝ ; (s) ⊦ ⌜nf⌝ from n = ⌜nf from n⌝ ; (s) ⊦ ⌜nf⌝ [n] = nf(n); (s) ⊦ ¬ finp(⌜nf⌝ ); (s) ⊦ [] ≠ ⌜nf⌝ ; (s) stream-inf-forward: ⊦ ¬ finp(σ) → (∃ nf. ⌜nf⌝ = σ); (forward) from specification stream-basic ⊦ ⌜m⌝ < ∞; (s) ⊦ ¬ finp(σ) → # σ = ∞; (s)

Proof step 49 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, nf to ii(1) + 1 = nextl(0, a), (nf from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), lf(n0) ≠ [], nextl(0, a) ≠ [], a ∈ nextl(0, a), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1), ∀ n. nf(ii(n)) = lf(n).last, ∀ n2. ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1 ∧ (nf from ii(n2)) to # lf(n2 + 1) = lf(n2 + 1) ⊦ ∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 16 terms: n1 abort: F discard: T computed: F

Additional information

Used terms: n1

Proof step 50 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (nf from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), nf to ii(1) + 1 = nextl(0, a), lf(n0) ≠ [], nextl(0, a) ≠ [], a ∈ nextl(0, a), ∀ n2. ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1 ∧ (nf from ii(n2)) to # lf(n2 + 1) = lf(n2 + 1), ∀ n. nf(ii(n)) = lf(n).last, ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1) ⊦ ∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ m < n → n ≠ 0; (s) fle-01: ⊦ m ≤ n ∧ n < n0 → m < n0; (forward) from specification nat f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic

Proof step 51 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (nf from ii(n0)) to # lf(n0 + 1) = lf(n0 + 1), nf to ii(1) + 1 = nextl(0, a), lf(n0) ≠ [], nextl(0, a) ≠ [], ii(m) < ii(m + 1), n1 < ii(m + 1), a ∈ nextl(0, a), ii(m) ≤ n1, ∀ n2. ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1 ∧ (nf from ii(n2)) to # lf(n2 + 1) = lf(n2 + 1), ∀ n. nf(ii(n)) = lf(n).last, ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)

Heuristic quantifier closing applied rule exists right

And closed the goal!

Rule argument

pos: right 1 terms: m

Additional information

Used terms: m

Proof step 52 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) ≠ ⌜nextl(n0, σ[ii(n0)])⌝ , σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. σ[ii(n)] = lf(n).last, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦

User applied rule all left

And closed the goal!

Rule argument

pos: left 18 terms: n0 abort: F discard: F computed: F

Additional information

Used terms: n0

Proof step 53 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , ii(n0 + 1) ≠ ii(n0) + # nextl(n0, σ[ii(n0)]) - 1, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. σ[ii(n)] = lf(n).last, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦

User applied rule all left

And closed the goal!

Rule argument

pos: left 18 terms: n0 abort: F discard: F computed: F

Additional information

Used terms: n0

Proof step 54 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[0] ≠ a, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. σ[ii(n)] = lf(n).last, ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦

User applied rule all left

And closed the goal!

Rule argument

pos: left 18 terms: 0 abort: F discard: F computed: F

Additional information

Used simplifier rules: ⊦ a '.last = a; (s) Used terms: 0

Proof step 55 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ ∀ n. σ[ii(n)] = lf(n).last, (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 56 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 21 terms: n2 abort: F discard: F computed: F

Additional information

Used terms: n2

Proof step 57 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n2)) to # lf(n2 + 1) = ⌜lf(n2 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 58 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, (σ from ii(n2)) to # lf(n2 + 1) = ⌜lf(n2 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: stream, name:extensionality, seq: ⊦ σ0 = σ1 ↔ # σ0 = # σ1 ∧ (∀ n. ⌜n⌝ < # σ0 → σ0[n] = σ1[n]), subst:[σ1, σ0] → [⌜lf(n2 + 1)⌝ , (σ from ii(n2)) to # lf(n2 + 1)], <all paths>

Additional information

Used terms: ⌜lf(n2 + 1)⌝ , (σ from ii(n2)) to # lf(n2 + 1)

Proof step 59 from proof diag-theorem-butlast (previous step) (back to tree)

⊦ σ0 = σ1 ↔ # σ0 = # σ1 ∧ (∀ n. ⌜n⌝ < # σ0 → σ0[n] = σ1[n])

A spec-lemma

Proof step 60 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = # ⌜lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. ⌜n⌝ < #((σ from ii(n2)) to # lf(n2 + 1)) → ((σ from ii(n2)) to # lf(n2 + 1))[n] = ⌜lf(n2 + 1)⌝ [n] ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ ⌜m⌝ < ⌜n⌝ ↔ m < n; (s) ⊦ ⌜x⌝ [n] = x[n]; (s) ⊦ # ⌜x⌝ = ⌜# x⌝ ; (s)

Proof step 61 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n3. n3 < # lf(n2 + 1) → ((σ from ii(n2)) to # lf(n2 + 1))[n3] = lf(n2 + 1)[n3] ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 25 terms: 0 abort: F discard: T computed: F

Additional information

Used terms: 0

Proof step 62 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), 0 < # lf(n2 + 1) → ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2 + 1)[0], (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ x ≠ [] → x[0] = x.head; (s) ⊦ # x = 0 ↔ x = []; (s) ⊦ 0 < m ↔ m ≠ 0; (s)

Proof step 63 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), lf(n2 + 1) ≠ [] → ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2 + 1).head, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 24 terms: n2 abort: F discard: F computed: F

Additional information

Used terms: n2

Proof step 64 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), lf(n2 + 1) ≠ [] → ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2 + 1).head, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule all left

And obtained the following new goals

Rule argument

pos: left 24 terms: n2, lf(n2).last abort: F discard: F computed: T

Additional information

Used terms: n2, lf(n2).last

Proof step 65 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, nextl(n2, lf(n2).last).head = lf(n2).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(n2 + 1) = nextl(n2, lf(n2).last), lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], nextl(n2, lf(n2).last) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), lf(n2 + 1) ≠ [] → ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2 + 1).head, (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 66 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, lf(n2 + 1).head = lf(n2).last, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, ii(n2 + 1) = ii(n2) + # lf(n2 + 1) - 1, lf(n2 + 1) = nextl(n2, lf(n2).last), lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2 + 1) ≠ [], lf(n0) ≠ [], lf(n2) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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] → [ii(n2) + # lf(n2 + 1), m0]

Additional information

Used simplifier rules: ⊦ m + n = 0 ↔ m = 0 ∧ n = 0; (ws) ⊦ # x = 0 ↔ x = []; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic n ≠ 0 ⊦ m = n - 1 ↔ n = m + 1; (elim) Used terms: ii(n2) + # lf(n2 + 1), m0

Proof step 67 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2) + # lf(n2 + 1) = m0 + 1, lf(n2 + 1).head = lf(n2).last, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(n2 + 1) = m0, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , ii(n2) + # lf(n2 + 1) ≠ 0, σ[ii(n2)] ≠ lf(n2).last, lf(n2 + 1) ≠ [], lf(n0) ≠ [], lf(n2) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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 + 1 ≠ 0; (s)

Proof step 68 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, lf(n2 + 1).head = lf(n2).last, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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] → [lf(n2 + 1), a0, x1]

Additional information

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

Proof step 69 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, a0 = lf(n2).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(n2 + 1) = nextl(n2, lf(n2).last), lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), lf(n2 + 1) = a0 + x1, nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

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 in-14: ⊦ a ' + x = y → a ∈ y; (forward) from specification list ⊦ a + x = a ' + x; (s)

Proof step 70 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), lf(n2 + 1) = lf(n2).last ' + x1, nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), lf(n2).last ∈ lf(n2 + 1), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: stream, name:get-to, seq:m < n, ¬ # σ < ⌜n⌝ ⊦ (σ to n)[m] = σ[m], subst:[m, n, σ] → [0, # lf(n2 + 1), σ from ii(n2)], <all paths>

Additional information

Used terms: 0, # lf(n2 + 1), σ from ii(n2)

Proof step 71 from proof diag-theorem-butlast (previous step) (back to tree)

m < n, ¬ # σ < ⌜n⌝ ⊦ (σ to n)[m] = σ[m]

A spec-lemma

Proof step 72 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(n2 + 1) = lf(n2).last ' + x1, lf(n2 + 1) = nextl(n2, lf(n2).last), lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, lf(n2).last ∈ lf(n2 + 1), a ∈ nextl(0, a), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a, 0 < # lf(n2 + 1) ∧ ¬ #(σ from ii(n2)) < ⌜# lf(n2 + 1)⌝

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ # x = 0 ↔ x = []; (s) ⊦ 0 < m ↔ m ≠ 0; (s)

Proof step 73 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, #((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, ((σ from ii(n2)) to # lf(n2 + 1))[0] = lf(n2).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), lf(n2 + 1) = lf(n2).last ' + x1, nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, #(σ from ii(n2)) < ⌜# lf(n2 + 1)⌝ , a ∈ nextl(0, a), lf(n2).last ∈ lf(n2 + 1), (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule structural induction

And closed the goal!

Rule argument

indvar: σ

Additional information

Used simplifier rules: stream freely generated by ⌜ ⌝, ⌜ ⌝;; ⊦ ⌜x⌝ = ⌜x0⌝ ↔ x = x0; (s) ⊦ ⌜x⌝ [n] = x[n]; (s) ⊦ 0 < m ↔ m ≠ 0; (s) ⊦ # x = 0 ↔ x = []; (s) m < n ⊦ (nf to n)[m] = nf(m); (s) ⊦ ((nf from n))(0) = nf(n); (s) ⊦ ⌜nf⌝ from n = ⌜nf from n⌝ ; (s) ⊦ ⌜nf⌝ to n = ⌜nf to n⌝ ; (s) ⊦ # ⌜nf to n⌝ = ⌜n⌝ ; (s) ⊦ ⌜n⌝ = ⌜n0⌝ ↔ n = n0; (s) ⊦ ⌜nf⌝ [n] = nf(n); (s) ⊦ ⌜x⌝ = [] ↔ x = []; (s) ⊦ ⌜m⌝ < ⌜n⌝ ↔ m < n; (s) ⊦ finp(⌜x⌝ ); (s) ⊦ # ⌜x⌝ = ⌜# x⌝ ; (s) ⊦ ⌜n⌝ + ⌜m⌝ = ⌜n0⌝ ↔ n + m = n0; (s) add-assoc: ⊦ (n∞ + n∞1) + n∞2 = n∞ + n∞1 + n∞2; from specification nat-inf add-comm: ⊦ n∞1 + n∞2 = n∞2 + n∞1; from specification nat-inf ⊦ ⌜x⌝ from n = ⌜x from n⌝ ; (s) ⊦ ⌜x⌝ to n = ⌜x to n⌝ ; (s) ⊦ x ≠ [] → x[0] = x.head; (s) eqle-one: ⊦ m = n + 1 ∧ n < n0 → m ≤ n0; (forward) from specification nat ¬ # x < n ⊦ #(x from n) = # x - n; (s) ⊦ m ≤ n ↔ ¬ n < m; (ss) fle-01: ⊦ m ≤ n ∧ n < n0 → m < n0; (forward) from specification nat lf: ⊦ m < n ∧ n < n0 → m +1 < n0; (forward) from specification nat-basic trans: ⊦ n < n0 ∧ n0 < n1 → n < n1; (forward) from specification nat-basic 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 n0 ≤ n ⊦ n - n0 < m ↔ n < m + n0; (s) ⊦ m ≤ n → (n < m ↔ false); (s)

Proof step 74 from proof diag-theorem-butlast (previous step) (back to tree)

#((σ from ii(n2)) to # lf(n2 + 1)) = ⌜# lf(n2 + 1)⌝ , # nextl(0, a) = ii(1) + 1, ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, (σ from ii(n2))[0] = lf(n2).last, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, ii(0) = 0, lf(n2 + 1) = lf(n2).last ' + x1, lf(n2 + 1) = nextl(n2, lf(n2).last), lf(1) = nextl(0, a), lf(0) = a ', lf(n0 + 1) = nextl(n0, lf(n0).last), nextl(0, a) = a ' + x0, (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n0 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n2 + 1)⌝ < # σ, 0 < # lf(n2 + 1), lf(n2).last ∈ lf(n2 + 1), a ∈ nextl(0, a), ¬ #(σ from ii(n2)) < ⌜# lf(n2 + 1)⌝ , (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ , ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ # x = 0 ↔ x = []; (s) ⊦ 0 < m ↔ m ≠ 0; (s) ⊦ ⌜n⌝ = ⌜n0⌝ ↔ n = n0; (s) ¬ # σ < ⌜n⌝ ⊦ #(σ to n) = ⌜n⌝ ; (s)

Proof step 75 from proof diag-theorem-butlast (previous step) (back to tree)

# nextl(0, a) = ii(1) + 1, ii(n2) + # lf(n2 + 1) = ii(n2 + 1) + 1, (σ from ii(n2))[0] = lf(n2).last, ii(0) = 0, ii(n0 + 1) = ii(n0) + # lf(n0 + 1) - 1, lf(n0 + 1) = nextl(n0, lf(n0).last), lf(0) = a ', lf(1) = nextl(0, a), lf(n2 + 1) = nextl(n2, lf(n2).last), lf(n2 + 1) = lf(n2).last ' + x1, nextl(0, a) = a ' + x0, σ to ii(1) + 1 = ⌜nextl(0, a)⌝ , (σ from ii(n0)) to # lf(n0 + 1) = ⌜lf(n0 + 1)⌝ , σ[ii(n2)] ≠ lf(n2).last, lf(n2) ≠ [], lf(n0) ≠ [], lf(n2 + 1) ≠ [], nextl(0, a) ≠ [], σ ≠ [], ⌜ii(n2 + 1)⌝ < # σ, ⌜ii(1)⌝ < # σ, ⌜ii(n0 + 1)⌝ < # σ, a ∈ nextl(0, a), lf(n2).last ∈ lf(n2 + 1), ¬ #(σ from ii(n2)) < ⌜# lf(n2 + 1)⌝ , (finp(σ) ⊃ # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → lf(m + 1).tail = [] ∧ ii(m) = ii(n));∀ n. ∃ m. ii(m) ≤ n ∧ n < ii(m + 1)), ∀ n, a. nextl(n, a) ≠ [] ∧ nextl(n, a).head = a, ∀ n. lf(n + 1) = nextl(n, lf(n).last) ∧ lf(n) ≠ [], ∀ m, n. m ≤ n → ii(m) ≤ ii(n), ∀ n. ii(n + 1) = ii(n) + # lf(n + 1) - 1 ∧ ⌜ii(n + 1)⌝ < # σ ∧ (σ from ii(n)) to # lf(n + 1) = ⌜lf(n + 1)⌝ ⊦ (finp(σ) ⊃ ∃ n. # σ = ⌜ii(n)⌝ + ⌜1⌝ ∧ (∀ m. n ≤ m → nextl(m, σ[ii(m)]) = σ[ii(m)] ' ∧ ii(n) = ii(m));∃ m. ii(m) ≤ n1 ∧ n1 < ii(m + 1)) ∧ (σ from ii(n0)) to # nextl(n0, σ[ii(n0)]) = ⌜nextl(n0, σ[ii(n0)])⌝ ∧ ii(n0 + 1) = ii(n0) + # nextl(n0, σ[ii(n0)]) - 1 ∧ σ[0] = a

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: stream, name:get-from, seq: ⊦ ⌜n⌝ + ⌜m⌝ < # σ → (σ from n)[m] = σ[n + m], subst:[m, n, σ] → [0, ii(n2), σ], <all paths>

Additional information

Used simplifier rules: ⊦ n + 0 = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ n∞ + ⌜0⌝ = n∞; (s) add-assoc: ⊦ (n∞ + n∞1) + n∞2 = n∞ + n∞1 + n∞2; from specification nat-inf add-comm: ⊦ n∞1 + n∞2 = n∞2 + n∞1; from specification nat-inf lsle-trans: ⊦ n∞ < n∞1 ∧ ¬ n∞2 < n∞1 → n∞ < n∞2; (forward) from specification nat-inf ⊦ ⌜m⌝ < ⌜n⌝ ↔ m < n; (s) stream-fin-forward: ⊦ finp(σ) → (∃ x. ⌜x⌝ = σ); (forward) from specification stream-basic ⊦ ¬ finp(σ) → # σ = ∞; (s) ⊦ ⌜m⌝ < ∞; (s) eqle-one: ⊦ m = n + 1 ∧ n < n0 → m ≤ n0; (forward) from specification nat 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 + m0 ≤ m ↔ m0 = 0; (s) ⊦ # x = 0 ↔ x = []; (s) Used terms: 0, ii(n2), σ

Proof step 76 from proof diag-theorem-butlast (previous step) (back to tree)

⊦ ⌜n⌝ + ⌜m⌝ < # σ → (σ from n)[m] = σ[n + m]

A spec-lemma

Proof Tree for diag-theorem-butlast (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