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

minus(0, y) → 0
minus(s(x), 0) → s(x)
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
if(true, x, y) → x
if(false, x, y) → y
perfectp(0) → false
perfectp(s(x)) → f(x, s(0), s(x), s(x))
f(0, y, 0, u) → true
f(0, y, s(z), u) → false
f(s(x), 0, z, u) → f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) → if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

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), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Rewrite Strategy: INNERMOST

Infered types.

Rules:
minus'(0', y) → 0'
minus'(s'(x), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
le' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
if' :: true':false' → true':false' → true':false' → true':false'
perfectp' :: 0':s' → true':false'
f' :: 0':s' → 0':s' → 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', le', f'

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
le' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
if' :: true':false' → true':false' → true':false' → true':false'
perfectp' :: 0':s' → true':false'
f' :: 0':s' → 0':s' → 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:
minus', le', f'

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

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

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

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

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
le' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
if' :: true':false' → true':false' → true':false' → true':false'
perfectp' :: 0':s' → true':false'
f' :: 0':s' → 0':s' → 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:
minus'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), 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:
le', f'

They will be analysed ascendingly in the following order:
le' < f'

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

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

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

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

Rules:
minus'(0', y) → 0'
minus'(s'(x), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
le' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
if' :: true':false' → true':false' → true':false' → true':false'
perfectp' :: 0':s' → true':false'
f' :: 0':s' → 0':s' → 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:
minus'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
le'(_gen_0':s'3(_n961), _gen_0':s'3(_n961)) → true', rt ∈ Ω(1 + n961)

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:
f'

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

The following conjecture could not be proven:

f'(_gen_0':s'3(_n1726), _gen_0':s'3(0), _gen_0':s'3(_n1726), _gen_0':s'3(0)) →? true'

Rules:
minus'(0', y) → 0'
minus'(s'(x), 0') → s'(x)
minus'(s'(x), s'(y)) → minus'(x, y)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
perfectp'(0') → false'
perfectp'(s'(x)) → f'(x, s'(0'), s'(x), s'(x))
f'(0', y, 0', u) → true'
f'(0', y, s'(z), u) → false'
f'(s'(x), 0', z, u) → f'(x, u, minus'(z, s'(x)), u)
f'(s'(x), s'(y), z, u) → if'(le'(x, y), f'(s'(x), minus'(y, x), z, u), f'(x, u, z, u))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
le' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
if' :: true':false' → true':false' → true':false' → true':false'
perfectp' :: 0':s' → true':false'
f' :: 0':s' → 0':s' → 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:
minus'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
le'(_gen_0':s'3(_n961), _gen_0':s'3(_n961)) → true', rt ∈ Ω(1 + n961)

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