### (0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

sort(l) → st(0, l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0, 0) → true
equal(s(x), 0) → false
equal(0, s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0, v) → false
gt(s(u), 0) → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

Rewrite Strategy: FULL

### (1) DecreasingLoopProof (EQUIVALENT transformation)

The following loop(s) give(s) rise to the lower bound Ω(2n):
The rewrite sequence
max(cons(u, l)) →+ if(gt(u, max(l)), u, max(l))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0,1].
The pumping substitution is [l / cons(u, l)].
The result substitution is [ ].

The rewrite sequence
max(cons(u, l)) →+ if(gt(u, max(l)), u, max(l))
gives rise to a decreasing loop by considering the right hand sides subterm at position [2].
The pumping substitution is [l / cons(u, l)].
The result substitution is [ ].

### (3) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

### (4) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

sort(l) → st(0', l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0', 0') → true
equal(s(x), 0') → false
equal(0', s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0', v) → false
gt(s(u), 0') → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0'
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

S is empty.
Rewrite Strategy: FULL

Infered types.

### (6) Obligation:

TRS:
Rules:
sort(l) → st(0', l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0', 0') → true
equal(s(x), 0') → false
equal(0', s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0', v) → false
gt(s(u), 0') → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0'
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

Types:
sort :: cons:nil → cons:nil
st :: 0':s → cons:nil → cons:nil
0' :: 0':s
cond1 :: true:false → 0':s → cons:nil → cons:nil
member :: 0':s → cons:nil → true:false
true :: true:false
cons :: 0':s → cons:nil → cons:nil
s :: 0':s → 0':s
false :: true:false
cond2 :: true:false → 0':s → cons:nil → cons:nil
gt :: 0':s → 0':s → true:false
max :: cons:nil → 0':s
nil :: cons:nil
or :: true:false → true:false → true:false
equal :: 0':s → 0':s → true:false
if :: true:false → 0':s → 0':s → 0':s
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_cons:nil4_0 :: Nat → cons:nil
gen_0':s5_0 :: Nat → 0':s

### (7) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
st, member, gt, max, equal

They will be analysed ascendingly in the following order:
member < st
gt < st
max < st
equal < member
gt < max

### (8) Obligation:

TRS:
Rules:
sort(l) → st(0', l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0', 0') → true
equal(s(x), 0') → false
equal(0', s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0', v) → false
gt(s(u), 0') → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0'
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

Types:
sort :: cons:nil → cons:nil
st :: 0':s → cons:nil → cons:nil
0' :: 0':s
cond1 :: true:false → 0':s → cons:nil → cons:nil
member :: 0':s → cons:nil → true:false
true :: true:false
cons :: 0':s → cons:nil → cons:nil
s :: 0':s → 0':s
false :: true:false
cond2 :: true:false → 0':s → cons:nil → cons:nil
gt :: 0':s → 0':s → true:false
max :: cons:nil → 0':s
nil :: cons:nil
or :: true:false → true:false → true:false
equal :: 0':s → 0':s → true:false
if :: true:false → 0':s → 0':s → 0':s
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_cons:nil4_0 :: Nat → cons:nil
gen_0':s5_0 :: Nat → 0':s

Generator Equations:
gen_cons:nil4_0(0) ⇔ nil
gen_cons:nil4_0(+(x, 1)) ⇔ cons(0', gen_cons:nil4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))

The following defined symbols remain to be analysed:
gt, st, member, max, equal

They will be analysed ascendingly in the following order:
member < st
gt < st
max < st
equal < member
gt < max

### (9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
gt(gen_0':s5_0(n7_0), gen_0':s5_0(n7_0)) → false, rt ∈ Ω(1 + n70)

Induction Base:
gt(gen_0':s5_0(0), gen_0':s5_0(0)) →RΩ(1)
false

Induction Step:
gt(gen_0':s5_0(+(n7_0, 1)), gen_0':s5_0(+(n7_0, 1))) →RΩ(1)
gt(gen_0':s5_0(n7_0), gen_0':s5_0(n7_0)) →IH
false

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

### (11) Obligation:

TRS:
Rules:
sort(l) → st(0', l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0', 0') → true
equal(s(x), 0') → false
equal(0', s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0', v) → false
gt(s(u), 0') → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0'
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

Types:
sort :: cons:nil → cons:nil
st :: 0':s → cons:nil → cons:nil
0' :: 0':s
cond1 :: true:false → 0':s → cons:nil → cons:nil
member :: 0':s → cons:nil → true:false
true :: true:false
cons :: 0':s → cons:nil → cons:nil
s :: 0':s → 0':s
false :: true:false
cond2 :: true:false → 0':s → cons:nil → cons:nil
gt :: 0':s → 0':s → true:false
max :: cons:nil → 0':s
nil :: cons:nil
or :: true:false → true:false → true:false
equal :: 0':s → 0':s → true:false
if :: true:false → 0':s → 0':s → 0':s
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_cons:nil4_0 :: Nat → cons:nil
gen_0':s5_0 :: Nat → 0':s

Lemmas:
gt(gen_0':s5_0(n7_0), gen_0':s5_0(n7_0)) → false, rt ∈ Ω(1 + n70)

Generator Equations:
gen_cons:nil4_0(0) ⇔ nil
gen_cons:nil4_0(+(x, 1)) ⇔ cons(0', gen_cons:nil4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))

The following defined symbols remain to be analysed:
max, st, member, equal

They will be analysed ascendingly in the following order:
member < st
max < st
equal < member

### (12) RewriteLemmaProof (EQUIVALENT transformation)

Proved the following rewrite lemma:
max(gen_cons:nil4_0(n348_0)) → gen_0':s5_0(0), rt ∈ Ω(2n)

Induction Base:
max(gen_cons:nil4_0(0)) →RΩ(1)
0'

Induction Step:
max(gen_cons:nil4_0(+(n348_0, 1))) →RΩ(1)
if(gt(0', max(gen_cons:nil4_0(n348_0))), 0', max(gen_cons:nil4_0(n348_0))) →IH
if(gt(0', gen_0':s5_0(0)), 0', max(gen_cons:nil4_0(n348_0))) →LΩ(1)
if(false, 0', max(gen_cons:nil4_0(n348_0))) →IH
if(false, 0', gen_0':s5_0(0)) →RΩ(1)
gen_0':s5_0(0)

We have rt ∈ Ω(2n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(2n)

### (14) Obligation:

TRS:
Rules:
sort(l) → st(0', l)
st(n, l) → cond1(member(n, l), n, l)
cond1(true, n, l) → cons(n, st(s(n), l))
cond1(false, n, l) → cond2(gt(n, max(l)), n, l)
cond2(true, n, l) → nil
cond2(false, n, l) → st(s(n), l)
member(n, nil) → false
member(n, cons(m, l)) → or(equal(n, m), member(n, l))
or(x, true) → true
or(x, false) → x
equal(0', 0') → true
equal(s(x), 0') → false
equal(0', s(y)) → false
equal(s(x), s(y)) → equal(x, y)
gt(0', v) → false
gt(s(u), 0') → true
gt(s(u), s(v)) → gt(u, v)
max(nil) → 0'
max(cons(u, l)) → if(gt(u, max(l)), u, max(l))
if(true, u, v) → u
if(false, u, v) → v

Types:
sort :: cons:nil → cons:nil
st :: 0':s → cons:nil → cons:nil
0' :: 0':s
cond1 :: true:false → 0':s → cons:nil → cons:nil
member :: 0':s → cons:nil → true:false
true :: true:false
cons :: 0':s → cons:nil → cons:nil
s :: 0':s → 0':s
false :: true:false
cond2 :: true:false → 0':s → cons:nil → cons:nil
gt :: 0':s → 0':s → true:false
max :: cons:nil → 0':s
nil :: cons:nil
or :: true:false → true:false → true:false
equal :: 0':s → 0':s → true:false
if :: true:false → 0':s → 0':s → 0':s
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_cons:nil4_0 :: Nat → cons:nil
gen_0':s5_0 :: Nat → 0':s

Lemmas:
gt(gen_0':s5_0(n7_0), gen_0':s5_0(n7_0)) → false, rt ∈ Ω(1 + n70)

Generator Equations:
gen_cons:nil4_0(0) ⇔ nil
gen_cons:nil4_0(+(x, 1)) ⇔ cons(0', gen_cons:nil4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))

No more defined symbols left to analyse.

### (15) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
gt(gen_0':s5_0(n7_0), gen_0':s5_0(n7_0)) → false, rt ∈ Ω(1 + n70)