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

g(0, f(x, x)) → x
g(x, s(y)) → g(f(x, y), 0)
g(s(x), y) → g(f(x, y), 0)
g(f(x, y), 0) → f(g(x, 0), g(y, 0))

Rewrite Strategy: INNERMOST

Renamed function symbols to avoid clashes with predefined symbol.

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

g'(0', f'(x, x)) → x
g'(x, s'(y)) → g'(f'(x, y), 0')
g'(s'(x), y) → g'(f'(x, y), 0')
g'(f'(x, y), 0') → f'(g'(x, 0'), g'(y, 0'))

Rewrite Strategy: INNERMOST

Infered types.

Rules:
g'(0', f'(x, x)) → x
g'(x, s'(y)) → g'(f'(x, y), 0')
g'(s'(x), y) → g'(f'(x, y), 0')
g'(f'(x, y), 0') → f'(g'(x, 0'), g'(y, 0'))

Types:
g' :: 0':f':s' → 0':f':s' → 0':f':s'
0' :: 0':f':s'
f' :: 0':f':s' → 0':f':s' → 0':f':s'
s' :: 0':f':s' → 0':f':s'
_hole_0':f':s'1 :: 0':f':s'
_gen_0':f':s'2 :: Nat → 0':f':s'

Heuristically decided to analyse the following defined symbols:
g'

Rules:
g'(0', f'(x, x)) → x
g'(x, s'(y)) → g'(f'(x, y), 0')
g'(s'(x), y) → g'(f'(x, y), 0')
g'(f'(x, y), 0') → f'(g'(x, 0'), g'(y, 0'))

Types:
g' :: 0':f':s' → 0':f':s' → 0':f':s'
0' :: 0':f':s'
f' :: 0':f':s' → 0':f':s' → 0':f':s'
s' :: 0':f':s' → 0':f':s'
_hole_0':f':s'1 :: 0':f':s'
_gen_0':f':s'2 :: Nat → 0':f':s'

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

The following defined symbols remain to be analysed:
g'

Proved the following rewrite lemma:
g'(_gen_0':f':s'2(+(1, _n4)), _gen_0':f':s'2(0)) → _*3, rt ∈ Ω(n4)

Induction Base:
g'(_gen_0':f':s'2(+(1, 0)), _gen_0':f':s'2(0))

Induction Step:
g'(_gen_0':f':s'2(+(1, +(_\$n5, 1))), _gen_0':f':s'2(0)) →RΩ(1)
f'(g'(0', 0'), g'(_gen_0':f':s'2(+(1, _\$n5)), 0')) →IH
f'(g'(0', 0'), _*3)

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

Rules:
g'(0', f'(x, x)) → x
g'(x, s'(y)) → g'(f'(x, y), 0')
g'(s'(x), y) → g'(f'(x, y), 0')
g'(f'(x, y), 0') → f'(g'(x, 0'), g'(y, 0'))

Types:
g' :: 0':f':s' → 0':f':s' → 0':f':s'
0' :: 0':f':s'
f' :: 0':f':s' → 0':f':s' → 0':f':s'
s' :: 0':f':s' → 0':f':s'
_hole_0':f':s'1 :: 0':f':s'
_gen_0':f':s'2 :: Nat → 0':f':s'

Lemmas:
g'(_gen_0':f':s'2(+(1, _n4)), _gen_0':f':s'2(0)) → _*3, rt ∈ Ω(n4)

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

No more defined symbols left to analyse.

The lowerbound Ω(n) was proven with the following lemma:
g'(_gen_0':f':s'2(+(1, _n4)), _gen_0':f':s'2(0)) → _*3, rt ∈ Ω(n4)