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

le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
zero(0) → true
zero(s(x)) → false
id(0) → 0
id(s(x)) → s(id(x))
minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
mod(x, y) → if_mod(zero(x), zero(y), le(y, x), id(x), id(y))
if_mod(true, b1, b2, x, y) → 0
if_mod(false, b1, b2, x, y) → if2(b1, b2, x, y)
if2(true, b2, x, y) → 0
if2(false, b2, x, y) → if3(b2, x, y)
if3(true, x, y) → mod(minus(x, y), s(y))
if3(false, x, y) → x

Rewrite Strategy: INNERMOST

Renamed function symbols to avoid clashes with predefined symbol.

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

le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Rewrite Strategy: INNERMOST

Infered types.

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Heuristically decided to analyse the following defined symbols:
le', id', minus', mod'

They will be analysed ascendingly in the following order:
le' < mod'
id' < mod'
minus' < mod'

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
le', id', minus', mod'

They will be analysed ascendingly in the following order:
le' < mod'
id' < mod'
minus' < mod'

Proved the following rewrite lemma:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)

Induction Base:
le'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
true'

Induction Step:
le'(_gen_0':s'3(+(_\$n6, 1)), _gen_0':s'3(+(_\$n6, 1))) →RΩ(1)
le'(_gen_0':s'3(_\$n6), _gen_0':s'3(_\$n6)) →IH
true'

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

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
id', minus', mod'

They will be analysed ascendingly in the following order:
id' < mod'
minus' < mod'

Proved the following rewrite lemma:
id'(_gen_0':s'3(_n887)) → _gen_0':s'3(_n887), rt ∈ Ω(1 + n887)

Induction Base:
id'(_gen_0':s'3(0)) →RΩ(1)
0'

Induction Step:
id'(_gen_0':s'3(+(_\$n888, 1))) →RΩ(1)
s'(id'(_gen_0':s'3(_\$n888))) →IH
s'(_gen_0':s'3(_\$n888))

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

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
id'(_gen_0':s'3(_n887)) → _gen_0':s'3(_n887), rt ∈ Ω(1 + n887)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
minus', mod'

They will be analysed ascendingly in the following order:
minus' < mod'

Proved the following rewrite lemma:
minus'(_gen_0':s'3(_n1528), _gen_0':s'3(_n1528)) → _gen_0':s'3(0), rt ∈ Ω(1 + n1528)

Induction Base:
minus'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(0)

Induction Step:
minus'(_gen_0':s'3(+(_\$n1529, 1)), _gen_0':s'3(+(_\$n1529, 1))) →RΩ(1)
minus'(_gen_0':s'3(_\$n1529), _gen_0':s'3(_\$n1529)) →IH
_gen_0':s'3(0)

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

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
id'(_gen_0':s'3(_n887)) → _gen_0':s'3(_n887), rt ∈ Ω(1 + n887)
minus'(_gen_0':s'3(_n1528), _gen_0':s'3(_n1528)) → _gen_0':s'3(0), rt ∈ Ω(1 + n1528)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
mod'

Could not prove a rewrite lemma for the defined symbol mod'.

Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
zero'(0') → true'
zero'(s'(x)) → false'
id'(0') → 0'
id'(s'(x)) → s'(id'(x))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
mod'(x, y) → if_mod'(zero'(x), zero'(y), le'(y, x), id'(x), id'(y))
if_mod'(true', b1, b2, x, y) → 0'
if_mod'(false', b1, b2, x, y) → if2'(b1, b2, x, y)
if2'(true', b2, x, y) → 0'
if2'(false', b2, x, y) → if3'(b2, x, y)
if3'(true', x, y) → mod'(minus'(x, y), s'(y))
if3'(false', x, y) → x

Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
zero' :: 0':s' → true':false'
id' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
mod' :: 0':s' → 0':s' → 0':s'
if_mod' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → 0':s'
if2' :: true':false' → true':false' → 0':s' → 0':s' → 0':s'
if3' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
id'(_gen_0':s'3(_n887)) → _gen_0':s'3(_n887), rt ∈ Ω(1 + n887)
minus'(_gen_0':s'3(_n1528), _gen_0':s'3(_n1528)) → _gen_0':s'3(0), rt ∈ Ω(1 + n1528)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

No more defined symbols left to analyse.

The lowerbound Ω(n) was proven with the following lemma:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)