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

leq(0, y) → true
leq(s(x), 0) → false
leq(s(x), s(y)) → leq(x, y)
if(true, x, y) → x
if(false, x, y) → y
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
mod(0, y) → 0
mod(s(x), 0) → 0
mod(s(x), s(y)) → if(leq(y, x), mod(-(s(x), s(y)), s(y)), s(x))

Rewrite Strategy: INNERMOST

Renamed function symbols to avoid clashes with predefined symbol.

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

leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Rewrite Strategy: INNERMOST

Infered types.

Rules:
leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Types:
leq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
if' :: true':false' → 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
mod' :: 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:
leq', -', mod'

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

Rules:
leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Types:
leq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
if' :: true':false' → 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
mod' :: 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:
leq', -', mod'

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

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

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

Induction Step:
leq'(_gen_0':s'3(+(_\$n6, 1)), _gen_0':s'3(+(_\$n6, 1))) →RΩ(1)
leq'(_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:
leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Types:
leq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
if' :: true':false' → 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
mod' :: 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:
leq'(_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:
-', mod'

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

Proved the following rewrite lemma:
-'(_gen_0':s'3(_n533), _gen_0':s'3(_n533)) → _gen_0':s'3(0), rt ∈ Ω(1 + n533)

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

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

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

Rules:
leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Types:
leq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
if' :: true':false' → 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
mod' :: 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:
leq'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
-'(_gen_0':s'3(_n533), _gen_0':s'3(_n533)) → _gen_0':s'3(0), rt ∈ Ω(1 + n533)

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:
leq'(0', y) → true'
leq'(s'(x), 0') → false'
leq'(s'(x), s'(y)) → leq'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
mod'(0', y) → 0'
mod'(s'(x), 0') → 0'
mod'(s'(x), s'(y)) → if'(leq'(y, x), mod'(-'(s'(x), s'(y)), s'(y)), s'(x))

Types:
leq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
if' :: true':false' → 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
mod' :: 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:
leq'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
-'(_gen_0':s'3(_n533), _gen_0':s'3(_n533)) → _gen_0':s'3(0), rt ∈ Ω(1 + n533)

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:
leq'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)