TC0
{{short description|Complexity class used in circuit complexity}}
{{DISPLAYTITLE:TC0}}
In theoretical computer science, and specifically computational complexity theory and circuit complexity, TC0 (Threshold Circuit) is the first class in the hierarchy of TC classes. TC0 contains all languages which are decided by Boolean circuits with constant depth and polynomial size, containing only unbounded fan-in AND gates, OR gates, NOT gates, and MAJ gates, or equivalently, threshold gates.
TC0 contains several important problems, such as sorting n n-bit numbers, multiplying two n-bit numbers, integer division{{cite journal |last1=Hesse |first1=William |last2=Allender |first2=Eric |last3=Mix Barrington |first3=David |year=2002 |title=Uniform constant-depth threshold circuits for division and iterated multiplication |journal=Journal of Computer and System Sciences |volume=65 |issue=4 |pages=695–716 |doi=10.1016/S0022-0000(02)00025-9 |doi-access=free}} or recognizing the Dyck language with two types of parentheses. It is commonly used to model the computational complexity of bounded-depth neural networks, and indeed, it was originally proposed for this purpose.{{Cite journal |last1=Parberry |first1=Ian |last2=Schnitger |first2=Georg |date=1988-06-01 |title=Parallel computation with threshold functions |url=https://dx.doi.org/10.1016/0022-0000%2888%2990030-X |journal=Journal of Computer and System Sciences |volume=36 |issue=3 |pages=278–302 |doi=10.1016/0022-0000(88)90030-X |issn=0022-0000}}
Definitions
A Boolean circuit family is a sequence of Boolean circuits consisting of a feedforward network of Boolean functions. A binary language is in the TC0 class if there exists a Boolean circuit family , such that
- There exists a polynomial function , and a constant .
- Each is composed of up to unbounded fan-in AND, OR, NOT, and MAJ gates in up to layers.
- For each , we have iff .
File:Artificial_neuron_structure.svg
Equivalently, instead of majority gates, we can use threshold gates with integer weights and thresholds, bounded by a polynomial. A threshold gate with inputs is defined by a list of weights and a single threshold . Upon binary inputs , it outputs if , else it outputs . A threshold gate is also called an artificial neuron.
Given a Boolean circuit with AND, OR, NOT, and threshold gates whose weights and thresholds are bounded within , If we also provide the network with negations of binary inputs: , then we can convert the network to one that computes the same input-output function using only AND, OR, and threshold gates, with the same depth, at most double the number of gates in each layer, weights bounded within , and thresholds bounded within . Therefore, TC0 can be defined equivalently as the languages decidable by some Boolean circuit family such that
- There exists a polynomial function , and a constant .
- Each is composed of up to threshold gates in up to layers, whose weights are non-negative integers, thresholds are integers, and both weights and thresholds are bounded within .
- For each , we have iff .
In this article, we by default consider Boolean circuits with a polynomial number of AND, OR, NOT, and threshold gates, with polynomial bound on integer weights and thresholds. The polynomial bound on weights and thresholds can be relaxed without changing the class .
In arithmetic circuit complexity theory, can be equivalently characterized as the class of languages defined as the images of , where each is computed by a polynomial-size constant-depth unbounded-fan-in arithmetic circuits with + and × gates, and constants from .{{Cite journal |last1=Agrawal |first1=Manindra |last2=Allender |first2=Eric |last3=Datta |first3=Samir |date=April 2000 |title=On TC0, AC0, and Arithmetic Circuits |url=https://linkinghub.elsevier.com/retrieve/pii/S0022000099916756 |journal=Journal of Computer and System Sciences |language=en |volume=60 |issue=2 |pages=395–421 |doi=10.1006/jcss.1999.1675}}
Complexity class relations
{{unsolved|computer science|}}
We can relate TC0 to other circuit classes, including AC0 and NC1 as follows:{{cite book | last=Vollmer | first=Heribert | title=Introduction to circuit complexity. A uniform approach | series=Texts in Theoretical Computer Science | location=Berlin | publisher=Springer-Verlag | year=1998 | isbn=3-540-64310-9 | zbl=0931.68055 | url=https://books.google.com/books?id=55ZTgOJs8bsC|page=126}}
Whether
is a strict inclusion is "one of the main open problems in circuit complexity". In fact, it is even open whether
is a strict inclusion! This is in some sense unsurprising, since there is no natural proof for
, assuming that there is a cryptographically secure pseudorandom number generator in
, which have been explicitly constructed under the assumption that factoring Blum integers is hard (i.e. requires circuits of size ), which is widely suspected to be true.{{Cite journal |last1=Naor |first1=Moni |last2=Reingold |first2=Omer |date=March 2004 |title=Number-theoretic constructions of efficient pseudo-random functions |url=https://dl.acm.org/doi/10.1145/972639.972643 |journal=Journal of the ACM |language=en |volume=51 |issue=2 |pages=231–262 |doi=10.1145/972639.972643 |issn=0004-5411}} More generally, randomness and hardness for have been shown to be closely related.{{Cite book |last1=Hatami |first1=Pooya |last2=Hoza |first2=William M. |last3=Tal |first3=Avishay |last4=Tell |first4=Roei |chapter=Fooling Constant-Depth Threshold Circuits (Extended Abstract) |date=February 2022 |title=2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS) |chapter-url=https://par.nsf.gov/servlets/purl/10384268 |publisher=IEEE |pages=104–115 |doi=10.1109/FOCS52979.2021.00019 |isbn=978-1-6654-2055-6}} It is also an open question whether
. Indeed,
Note that because non-uniform
and
can compute functions that are not Turing-computable, it is certainly the case that
and
. The 2011 result simply shows that
and
are incomparable classes. The open question is whether
and
are incomparable as well.
Note that, while the time hierarchy theorem proves that
, both complexity classes are uniform, meaning that a single Turing machine is responsible for solving the problem at any input length. In contrast, a
circuit family may be non-uniform, meaning that there may be no good algorithm for finding the correct circuit, other than exhaustive search over all
possible Boolean circuits of bounded depth and
size, then checking all possible inputs to verify that the circuit is correct.
It has been proven that if , then any , there exists a
circuit family of gate number that solves the Boolean Formula Evaluation problem. Thus, any superlinear bound suffices to prove .{{Cite journal |last1=Allender |first1=Eric |last2=Koucký |first2=Michal |date=March 2010 |title=Amplifying lower bounds by means of self-reducibility |url=https://dl.acm.org/doi/10.1145/1706591.1706594 |journal=Journal of the ACM |language=en |volume=57 |issue=3 |pages=1–36 |doi=10.1145/1706591.1706594 |issn=0004-5411}}
Uniform TC<sup>0</sup>
DLOGTIME-uniform
is also known as
, because it is equivalent to first-order logic with Majority quantifiers.{{Cite journal |last1=Mix Barrington |first1=David A. |last2=Immerman |first2=Neil |last3=Straubing |first3=Howard |date=1990-12-01 |title=On uniformity within NC1 |url=https://dx.doi.org/10.1016/0022-0000%2890%2990022-D |journal=Journal of Computer and System Sciences |volume=41 |issue=3 |pages=274–306 |doi=10.1016/0022-0000(90)90022-D |issn=0022-0000}} Specifically, given a logic formula that takes Boolean variables, a Majority quantifier is used as follows: given a formula with exactly one free variable , the quantified is true iff is true for over half of , Integer division (given -bit integers, find ), powering (given an -bit integer, and a -bit integer, find ), and iterated multiplication (multiplying of -bit integers) are all in DLOGTIME-uniform
.{{Citation |last=Hesse |first=William |title=Division Is In Uniform TC0 |date=2001 |work=Automata, Languages and Programming |series=Lecture Notes in Computer Science |volume=2076 |pages=104–114 |editor-last=Orejas |editor-first=Fernando |url=https://link.springer.com/chapter/10.1007/3-540-48224-5_9 |access-date=2025-03-19 |place=Berlin, Heidelberg |publisher=Springer Berlin Heidelberg |language=en |doi=10.1007/3-540-48224-5_9 |isbn=978-3-540-42287-7 |editor2-last=Spirakis |editor2-first=Paul G. |editor3-last=van Leeuwen |editor3-first=Jan}} It is usually considered the appropriate level of uniformity for
, neither too strong nor too weak. Specifically, because P is usually suspected to be stronger than
, while DLOGTIME is suspected to be equivalent in strength in some sense, DLOGTIME-uniformity is usually assumed, when uniformity is considered for
The permanent of a 0-1 matrix is not in uniform
Uniform .{{cite book | first=E. | last=Allender | chapter= A note on uniform circuit lower bounds for the counting hierarchy | title=Proceedings 2nd International Computing and Combinatorics Conference (COCOON) | volume=1090 | series=Springer Lecture Notes in Computer Science | pages=127–135 | year=1996 }} As cited in {{cite journal | last1 = Burtschick | first1 = Hans-Jörg | last2 = Vollmer | first2 = Heribert | doi = 10.1142/S0129054198000180 | id = {{ECCC|1996|96|005}} | issue = 3 | journal = International Journal of Foundations of Computer Science | pages = 277–294 | title = Lindström quantifiers and leaf language definability | volume = 9 | year = 1998}}
The functional version of the uniform TC0 coincides with the closure with respect to composition of the projections and one of the following function sets , .{{cite arXiv |eprint=1611.04843 |class=cs.CC |first=Sergey. |last=Volkov |title=Finite Bases with Respect to the Superposition in Classes of Elementary Recursive Functions, dissertation |year=2016}} Here , is a bitwise AND of and . By functional version one means the set of all functions over non-negative integers that are bounded by functions of FP and is in the uniform TC0.
Fine structure
TC0 can be divided further, into a hierarchy of languages requiring up to 1 layer, 2 layers, etc. Let be the class of languages decidable by a threshold circuit family of up to depth :The hierarchy can be even more finely divided.
= MAJ vs threshold =
The MAJ gate is sometimes called an unweighted threshold gate. They are equivalent up to a uniform polynomial overhead. In detail:
- A MAJ gate is a threshold gate where all the weights are 1, and threshold is the fan-in.
- A polynomial-size circuit containing threshold gates with polynomial integer weights and threshold can be converted to a polynomial-size circuit with the same depth. Specifically, the weights can be simulated by replicating the input circuits, and the threshold can be simulated by replicating constant True/False inputs.
Furthermore, there is an explicit algorithm, by which, given a single -input threshold gate with arbitrary (unbounded) integer weights and thresholds, it constructs a depth-2 circuit using -many AND, OR, NOT, and MAJ gates. Thus, any polynomial-size, depth- threshold circuit can be simulated uniformly by a polynomial-size majority circuit of depth .{{Cite journal |last1=Goldmann |first1=Mikael |last2=Håstad |first2=Johan |last3=Razborov |first3=Alexander |date=1992-12-01 |title=Majority gates vs. general weighted threshold gates |url=https://link.springer.com/article/10.1007/BF01200426 |journal=Computational Complexity |language=en |volume=2 |issue=4 |pages=277–300 |doi=10.1007/BF01200426 |issn=1420-8954}}{{Cite journal |last1=Goldmann |first1=Mikael |last2=Karpinski |first2=Marek |date=February 1998 |title=Simulating Threshold Circuits by Majority Circuits |url=http://epubs.siam.org/doi/10.1137/S0097539794274519 |journal=SIAM Journal on Computing |language=en |volume=27 |issue=1 |pages=230–246 |doi=10.1137/S0097539794274519 |issn=0097-5397}}
As a separation theorem, it is known that the
-input Boolean inner product function (IP), defined below, is computable by a majority circuit with 3 layers and
gates, but is not computable by a threshold circuit with 2 layers and
= Arbitrary threshold gate =
For any fixed , because there are only finitely many Boolean functions that can be computed by a threshold logic unit, it is possible to set all to be integers. Let be the smallest number such that every possible real threshold function of variables can be realized using integer weights of absolute value . It is known that{{Cite journal |last1=Alon |first1=Noga |last2=Vũ |first2=Văn H |date=1997-07-01 |title=Anti-Hadamard Matrices, Coin Weighing, Threshold Gates, and Indecomposable Hypergraphs |url=https://linkinghub.elsevier.com/retrieve/pii/S0097316597927801 |journal=Journal of Combinatorial Theory, Series A |volume=79 |issue=1 |pages=133–160 |doi=10.1006/jcta.1997.2780 |issn=0097-3165}}See {{Cite book |last=Jukna |first=Stasys |title=Boolean Function Complexity: Advances and Frontiers |date=2012 |publisher=Springer Berlin Heidelberg |isbn=978-3-642-24507-7 |series=Algorithms and Combinatorics |location=Berlin, Heidelberg}}{{Pg|location=Section 11.10}} for a literature review.
Sometimes the class of polynomial-bounded weights and thresholds with depth is denoted as , and denotes the class where the weight and thresholds are unbounded ("large weight threshold circuit"). This formalizes neural networks with real-valued activation functions.{{Cite journal |last1=Šíma |first1=Jiří |last2=Orponen |first2=Pekka |date=2003-12-01 |title=General-Purpose Computation with Neural Networks: A Survey of Complexity Theoretic Results |url=https://direct.mit.edu/neco/article/15/12/2727-2778/6791 |journal=Neural Computation |language=en |volume=15 |issue=12 |pages=2727–2778 |doi=10.1162/089976603322518731 |pmid=14629867 |issn=0899-7667}}
As previously stated, any polynomial-size, depth- threshold circuit can be simulated uniformly by a polynomial-size majority circuit of depth . Therefore, . It has been proven that .
Allowing the sigmoid activation function does not increase the power, that is, for all , assuming the weights are polynomially bounded.{{Cite book |last1=Maass |first1=W. |last2=Schnitger |first2=G. |last3=Sontag |first3=E.D. |chapter=On the computational power of sigmoid versus Boolean threshold circuits |date=1991 |title=[1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science |chapter-url=https://ieeexplore.ieee.org/document/185447 |publisher=IEEE Comput. Soc. Press |pages=767–776 |doi=10.1109/SFCS.1991.185447 |isbn=978-0-8186-2445-2}}
= Probabilistic version =
Like how the P class has a probabilistic version BPP, the has a probabilistic version . It is defined as the class of languages that can be polynomial-probabilistically decided.
Let be a Boolean circuit family that takes two kinds of inputs. A given circuit takes the deterministic inputs , and the random inputs , where . The random inputs are sampled uniformly over all possibilities.
A language is decided polynomial-probabilistically by the family if for each , if , then the probability that is at least , and if , then the probability that is at most .
Similarly, (feedforward) Boltzmann machines have been modelled as circuits with boundedly-unreliable threshold units. That is, each threshold unit may, independently at random, with a bounded probability , make the wrong output.{{Cite journal |last1=Parberry |first1=Ian |last2=Schnitger |first2=Georg |date=1989-01-01 |title=Relating Boltzmann machines to conventional models of computation |url=https://www.sciencedirect.com/science/article/abs/pii/0893608089900154 |journal=Neural Networks |volume=2 |issue=1 |pages=59–67 |doi=10.1016/0893-6080(89)90015-4 |issn=0893-6080}}
Sometimes, this class is also called , in a closer analogy with BPP. In this definition, the probability that is at least , and if , then the probability that is at most . By the standard trick of sampling many times then taking the majority opinion, any -layer circuit can be converted to a -layer circuit.
= Hierarchy =
Analogous to how , can also be divided intoBy definition, . Furthermore, since , there is a full hierarchy: Similarly, allowing boundedly-unreliable threshold units, a circuit can be converted to a circuit by running several copies of the original circuit in parallel, each with a fixed choice for the random inputs (a hardcoded advice), and then taking a Majority over their outputs. That at least one advice exists is proven by Hoeffding's inequality, with essentially the same argument as the median trick. This argument is merely an existence proof, and thus not uniform in a way that matters for , since it gives no algorithm for discovering the advice other than brute-force enumeration.
Let be defined as the parity function, or the XOR function. Then the following two separations are theorems:
- : The PARITY function is in , but not in .
- : The Boolean inner product function (IP) is in but not in , where
The inner product function falls outside in a precise sense:{{Pg|location=Section 11.10.2}}
- If the weights of the bottom gates of a threshold circuit of depth 2 computing are polynomial, then for any , for all large enough , requires gates.
- If the weights of the top gate in a threshold circuit of depth 2 computing are at most , then the top gate must have fanin at least .{{Cite journal |last1=Hajnal |first1=András |last2=Maass |first2=Wolfgang |last3=Pudlák |first3=Pavel |last4=Szegedy |first4=Márió |last5=Turán |first5=György |date=April 1993 |title=Threshold circuits of bounded depth |url=https://linkinghub.elsevier.com/retrieve/pii/002200009390001D |journal=Journal of Computer and System Sciences |language=en |volume=46 |issue=2 |pages=129–154 |doi=10.1016/0022-0000(93)90001-D}}
- If the weights of the bottom gates of a threshold circuit of depth 2 computing do not exceed , then the top gate must have fanin at least .{{Citation |last1=Forster |first1=Jürgen |title=Relations Between Communication Complexity, Linear Arrangements, and Computational Complexity |date=2001 |work=FST TCS 2001: Foundations of Software Technology and Theoretical Computer Science |volume=2245 |pages=171–182 |editor-last=Hariharan |editor-first=Ramesh |url=http://link.springer.com/10.1007/3-540-45294-X_15 |access-date=2025-03-19 |place=Berlin, Heidelberg |publisher=Springer Berlin Heidelberg |doi=10.1007/3-540-45294-x_15 |isbn=978-3-540-43002-5 |last2=Krause |first2=Matthias |last3=Lokam |first3=Satyanarayana V. |last4=Mubarakzjanov |first4=Rustam |last5=Schmitt |first5=Niels |last6=Simon |first6=Hans Ulrich |editor2-last=Vinay |editor2-first=V. |editor3-last=Mukund |editor3-first=Madhavan}}
It is an open question how many levels the hierarchy has. It is also an open question whether the hierarchy collapses, that is, . In fact, there is still no exponential lower bound for . Therefore, a fortiori, there is still no exponential lower bound for depth-3 polynomial-size majority circuits. There are exponential lower bounds if further restrictions are imposed on layer 1, such as requiring it to only contain AND gates, or only bounded fan-in gates.{{Pg|location=Section 11.10.3}}
The hierarchy for monotone
(that is,
without Boolean negations) is strongly separated. Specifically, for each , there has been constructed a language that is decidable by a depth circuit family using only
AND and OR gates, but requires exponential size to compute by a monotone
If the polynomial bound on the number of gates is relaxed, then
is quite powerful. Specifically, any language in
can be decided by a circuit family in
(using Majority gates), except that it uses a quasi-polynomial number of gates (instead of polynomial).{{Cite book |last=Allender |first=E. |chapter=A note on the power of threshold circuits |date=October 1989 |title=30th Annual Symposium on Foundations of Computer Science |chapter-url=https://ieeexplore.ieee.org/document/63538 |pages=580–584 |doi=10.1109/SFCS.1989.63538|isbn=0-8186-1982-1 }}{{cite conference
| last = Yao | first = Andrew Chi-Chih | author-link = Andrew Yao
| contribution = On ACC and threshold circuits
| doi = 10.1109/FSCS.1990.89583
| pages = 619–627
| publisher = IEEE Computer Society
| title = 31st Annual Symposium on Foundations of Computer Science, St. Louis, Missouri, USA, October 22–24, 1990, Volume II
| contribution-url = https://scholar.archive.org/work/qzvve2rlijhyvnsl7ql2zdtw4u
| year = 1990| isbn = 0-8186-2082-X }} This result is optimal, in that there exists a function that is computable with 3 layers of
, but requires at least an exponential number of gates for
(using Majority gates).{{citation
| last = Sherstov | first = Alexander A.
| doi = 10.1137/08071421X
| issue = 6
| journal = SIAM Journal on Computing
| mr = 2491551
| pages = 2113–2129
| title = Separating {{math|AC0}} from depth-2 majority circuits
| volume = 38
| year = 2009}}
References
{{reflist}}
Further reading
- {{cite book | last1=Clote | first1=Peter | last2=Kranakis |first2=Evangelos | title=Boolean functions and computation models | series=Texts in Theoretical Computer Science. An EATCS Series | location=Berlin | publisher=Springer-Verlag | year=2002 | isbn=3-540-59436-1 | zbl=1016.94046 }}
- {{Cite book |last1=Parberry |first1=Ian |url=https://direct.mit.edu/books/book/2708/Circuit-Complexity-and-Neural-Networks |title=Circuit Complexity and Neural Networks |last2=Garey |first2=Michael R. |last3=Meyer |first3=Albert |date=1994-07-27 |publisher=The MIT Press |isbn=978-0-262-28124-9 |language=en |doi=10.7551/mitpress/1836.001.0001}}