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

p(0) → s(s(0))
p(s(x)) → x
p(p(s(x))) → p(x)
le(p(s(x)), x) → le(x, x)
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
minus(x, y) → if(le(x, y), x, y)
if(true, x, y) → 0
if(false, x, y) → s(minus(p(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:

p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

Rewrite Strategy: INNERMOST

Infered types.

Rules:
p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

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

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

Rules:
p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

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

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

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

Rules:
p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

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

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

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

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

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

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

Rules:
p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

Types:
p' :: 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'
minus' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

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

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'

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

Rules:
p'(0') → s'(s'(0'))
p'(s'(x)) → x
p'(p'(s'(x))) → p'(x)
le'(p'(s'(x)), x) → le'(x, x)
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
minus'(x, y) → if'(le'(x, y), x, y)
if'(true', x, y) → 0'
if'(false', x, y) → s'(minus'(p'(x), y))

Types:
p' :: 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'
minus' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

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

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