[1] All math axioms can be expressed as grammar rules like the following:
A -> B
(directed)
A <-> BC
(undirected)
See [6].
[2] Given axiom length of n
(total symbols in your axioms) this has polynomial worst-case lengthening your axioms. See [13].
[3] We can introduce two non-terminals, (
and )
, and rewrite the rules in [1] as follows:
( A ) -> ( B )
(directed)
( A ) <-> ( ( B ) ( C ) )
(undirected)
[4] Given a target string, S = A1 A2 ... Am
for rules in [1] (S
is something we'd like to prove), the problem becomes, "find a permutation of parenthesis for S
such that rules in [2] generates S
."
[5] The parenthesis will put A1 A2 ... Am
into a binary tree.
[6] There are exponential worst-case combinations of parenthesis to consider: If A1 A2 ... Am
are vertices in a graph, there are m^2
possible edges to consider. If it's a tree, there are m-1
vertices. There are (at most) (m^2
choose m-1
) ways to put that into a tree. That is exponential worst-case.
[7] Each non-terminal may, via directed rules, be substituted for another non-terminal. Checking directed reachability is polynomial. This is in proportion to the number of non-terminals you have (which is worst-case total axiom length polynomial(n)
). This adds a polynomial overhead to each non-terminal you check.
[8] There are m
non-terminals to check in S
. As you replace ((B)(C))
with (A)
, you have a new non-terminal to check.
[9] This feels like an exhaustive search for each combination of parenthesis: You start with m
symbols. You have polynomial(n)
choices (by [7]). Each choice replaces 2 symbols with a new symbol (by [8]) that has polynomial(n)
choices (by [7]).
Does this come out to 2^(polynomial(n+m))
worst-case time complexity?
X>2^m
. So it's intuition to me. "again, see my answer" I'm still digesting your answer. – Jesus is Lord Apr 21 '20 at 15:33