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

minus(0, y) → 0
minus(s(x), y) → if(gt(s(x), y), x, y)
if(true, x, y) → s(minus(x, y))
if(false, x, y) → 0
mod(x, 0) → 0
mod(x, s(y)) → if1(lt(x, s(y)), x, s(y))
if1(true, x, y) → x
if1(false, x, y) → mod(minus(x, y), y)
gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
lt(x, 0) → false
lt(0, s(x)) → true
lt(s(x), s(y)) → lt(x, y)

Rewrite Strategy: INNERMOST

Renamed function symbols to avoid clashes with predefined symbol.

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

minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Rewrite Strategy: INNERMOST

Infered types.

Rules:
minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Heuristically decided to analyse the following defined symbols:
minus', gt', mod', lt'

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_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:
gt', minus', mod', lt'

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

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

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

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

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
gt'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → false', 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:
minus', mod', lt'

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

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
gt'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → false', 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:
lt', mod'

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

Proved the following rewrite lemma:
lt'(_gen_0':s'3(_n808), _gen_0':s'3(_n808)) → false', rt ∈ Ω(1 + n808)

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

Induction Step:
lt'(_gen_0':s'3(+(_\$n809, 1)), _gen_0':s'3(+(_\$n809, 1))) →RΩ(1)
lt'(_gen_0':s'3(_\$n809), _gen_0':s'3(_\$n809)) →IH
false'

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
mod'(x, 0') → 0'
mod'(x, s'(y)) → if1'(lt'(x, s'(y)), x, s'(y))
if1'(true', x, y) → x
if1'(false', x, y) → mod'(minus'(x, y), y)
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
lt'(x, 0') → false'
lt'(0', s'(x)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
gt'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → false', rt ∈ Ω(1 + n5)
lt'(_gen_0':s'3(_n808), _gen_0':s'3(_n808)) → false', rt ∈ Ω(1 + n808)

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

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
gt' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
mod' :: 0':s' → 0':s' → 0':s'
if1' :: true':false' → 0':s' → 0':s' → 0':s'
lt' :: 0':s' → 0':s' → true':false'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
gt'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → false', rt ∈ Ω(1 + n5)
lt'(_gen_0':s'3(_n808), _gen_0':s'3(_n808)) → false', rt ∈ Ω(1 + n808)

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