A Circuit Complexity Approach to Transductions

. Low circuit complexity classes and regular languages exhibit very tight interactions that shade light on their respective expressiveness. We propose to study these interactions at a functional level, by investigating the deterministic rational transductions computable by constant-depth, polysize circuits. To this end, a circuit framework of independent interest that allows variable output length is introduced. Relying on it, there is a general characterization of the set of transductions realizable by circuits. It is then decidable whether a transduction is deﬁnable in AC 0 and, assuming a well-established conjecture, the same for ACC 0 .


Introduction
The regular languages in circuit complexity classes play an instrumental role in some of the most emblematic results of circuit complexity. The celebrated result of Furst, Saxe and Sipser [11] shows that the regular language PARITY = {w ∈ {0, 1} * | |w| 1 ≡ 0 mod 2} is not in AC 0 , the class of constant-depth, polysize, unbounded fan-in circuits. As PARITY belongs to ACC 0 (which allows in addition unbounded fan-in modulo gates), this separates AC 0 and ACC 0 . Barrington's theorem [1] states that the regular languages are complete for the class NC 1 of logdepth, polysize, and constant fan-in circuits. Further, Koucký,Pudlák,and Thérien [12] show that regular languages separate classes defined by ACC 0 circuits using linear number of gates and using linear number of wires.
The classification of regular languages within circuit complexity classes thus attracted interest, culminating in the results of Barrington et al. [2] that entirely describe the regular languages in AC 0 , ACC 0 and NC 1 . The algebraic property of regular languages studied therein deviates sharply from the prevailing line of work at the time, which relied on the study of the syntactic monoids of regular languages. (The syntactic monoid is the monoid of transformations of states of the minimal automaton.) Indeed, PARITY / ∈ AC 0 , while the language EVEN of even-length words over {0, 1}, which has the same syntactic monoid, does belong to AC 0 . Hence the class of regular languages in AC 0 does not admit a characterization solely in terms of the syntactic monoids.
We propose to take this study to the functional case, that is, to characterize the functions realized by rational transducers (i.e., input/output automata) that are expressible by an AC 0 circuit family. Similarly to the context at the time of [2], we face a situation where, to the best of our knowledge, most characterizations focused on algebraic properties that would blur the line between PARITY and EVEN (e.g., [14]).
We rely on a property we call continuity for a class of languages V, as borrowed from the field of topology: a transduction τ is V-continuous if it preserves V by inverse image (i.e., ∀L ∈ V, τ −1 (L) ∈ V). It is well known that any transduction τ is continuous for the regular languages; together with an additional property on the output length of τ , this even characterizes deterministic transductions [3]. Namely, with d(u, v) , a strong form of uniform continuity. Continuity thus appears as a natural invariant when characterizing transductions-the forward behaviors of τ , that is, its images, are less relevant, as any NP problem is the image of Σ * under an AC 0 function [4]. Our contributions are three-fold: -We propose a model of circuits that allows for functions of unrestricted output length: as opposed to previous models, e.g., [19], we do not impose the existence of a mapping between the input and output lengths. -Relying on this model, we characterize the deterministic rational transductions computed by AC 0 circuits with access to gates in a given class. This characterization relies for one part on algebraic objects similar to the ones used in [2], through the use of the modern framework of lm-varieties [18]. For the other part, we rely on the notion of continuity. This bears a striking resemblance to the characterization of Reutenauer and Schützenberger [16] of the transductions with a group as transition monoid. -The characterization then leads to the decidability of the membership of a deterministic rational transduction in AC 0 or in ACC 0 . This is effective in the sense that an appropriate circuit can be produced realizing the transduction.
In Sect. 1, we succinctly cover the automata-and circuit-theoretic notions necessary to our presentation. In Sect. 2, we introduce the circuit model for variable output length functions and argue for its legitimacy. In Sect. 3, we show that studying the transition morphism of an automaton is equivalent to studying the languages accepted at each of its states; this enables us to keep to a minimum the algebraic references throughout our presentation. In Sect. 4, we show the aforementioned characterization and delay to Sect. 5 its implications on AC 0 and ACC 0 . We discuss the results and their limitations in Sect. 6.

Preliminaries
Monoid, morphisms, quotient. A monoid is a set equipped with a binary associative operation, denoted multiplicatively, with a unit element. For an alphabet Σ, the set Σ * is the free monoid generated by Σ, its unit element being the empty word ε. A morphism is a map ϕ : M → N satisfying ϕ(ab) = ϕ(a)ϕ(b) and ϕ(1) = 1, with a, b ∈ M and 1 denoting the unit element of M and N . A morphism ϕ : Σ * → T * is an lm-morphism, where lm stands for length-multiplying, if there is a k such that ϕ(Σ) ⊆ T k . Given a language L and a word u, the left quotient of L by u is the set u −1 L = {v | uv ∈ L}. The right quotient Lu −1 is defined symmetrically. For w ∈ Σ * and a ∈ Σ, we let |w| a be the number of a's in w, i.e., the image of w under the morphism a → 1, Σ \ {a} → 0 into (N, +).
Circuits. We use standard notations, as presented for instance in [17] and [19]. By AC 0 , we denote the class of languages recognized by constant-depth, polysize circuit families with Boolean gates of unbounded fan-in. We consider nonuniform families, that is, we leave unconstrained the mapping from the input size n to the circuit with n inputs. Such families recognize languages in L ⊆ {0, 1} * ; to extend this to any alphabet Σ, we always assume there is a canonical map from Σ to {0, 1} |Σ| , that lets us encode and decode words of Σ * in binary. A language L naturally defines an L-gate which outputs 1 iff its input is in L; for instance, {0, 1} * 1{0, 1} * defines the OR gate. For a class of languages V, we write AC 0 (V) for languages recognized by AC 0 circuit families with access to L-gates for all L ∈ V. We let ACC 0 = AC 0 (MOD) where MOD is the class of regular languages on {0, 1} * of the form {|w| 1 ≡ 0 mod k} for some k. Further, we define TC 0 = AC 0 (MAJ) where MAJ is the nonregular language {|w| 1 ≥ |w| 0 | w ∈ {0, 1} * }. We will occasionally rely on the conjectured and widely-believed separation of ACC 0 and TC 0 . Extending circuits to functions, a function f is in FAC 0 if there is a family of constant-depth, polysize circuits with multiple ordered output bits, such that f (u) is the output of the circuit for input size |u|. We naturally extend the notation AC 0 (V) to FAC 0 (V).

Automata. A deterministic automaton is a tuple
where Q is the finite set of states, Σ the alphabet, δ : Q × Σ → Q is a partial transition function, q 0 is the initial state, and F is the set of final states. We naturally extend δ to words by letting δ(q, ε) = q, and δ(q, aw) = δ(δ(q, a), w) when δ(q, a) is defined. We always assume that any state q is accessible and coaccessible, i.e., there is a word uv such that We often use the shorter terms V-all-separable and V-all-definable, of self-explanatory meanings. We write REG for the class of regular languages.

Continuity, Lm-varieties. A mapping
this name stems from the notion of continuity in topology. The sets of regular languages recognized by circuit families form a backbone of our work. It is thus natural to assume that these sets be closed under operations that AC 0 circuits can compute; this is formalized as follows. A class of languages V is an lm-variety if it is a Boolean algebra of languages closed under left and right quotient such that any lm-morphism is Vcontinuous. It can be shown that if AC 0 (V) ∩ REG = V, then V is an lm-variety. As is customary, we write QA for AC 0 ∩ REG and M sol for ACC 0 ∩ REG-these names stem from the algebraic classes recognizing the languages: quasi-aperiodic stamps and solvable monoids respectively, see Sect. 3 and [17] for more details.
In the sequel, the symbol V always denotes some lm-variety of languages.

Transducers. A deterministic transducer is a tuple
which is an automaton equipped with an additional alphabet T and a mapping ν : Q × Σ → T * of same domain as δ. We extend ν to words in Σ * by letting A transducer is said to be output-minimal if for every pair of states q, q , there is a word w such that either only one of δ(q, w) or δ(q , w) is final, or both are and ν(q, w) = ν(q , w). For any transduction τ , we fix an arbitrary output-minimal transducer MinT(τ ) realizing it. Note that given a transducer, one can easily compute an output-minimal transducer realizing the same transduction. We will see that the choice of MinT(τ ) does not bear any impact on the results.
We freely use Q, Σ, T, etc. when an automaton or a transducer is under study, with the understanding that they are the relevant components of its defining tuple. Our focus being solely on automata, transducers, and transductions that are deterministic, we will omit mentioning determinism from now on.

Circuit Frameworks for Variable-Length Functions
In the literature, most of the work on functions computed by circuits focus on variants of the class FAC 0 (see, e.g., [19]). In these, multiple (ordered) output gates are provided, and there is thus an implicit mapping from input length to output length. Towards circumventing this limitation, we propose a few different frameworks, and establish some formal shortcomings in order to legitimize our final choice. Our main requirement is that functions defined using constantdepth, polysize circuits should be AC 0 -continuous-this corresponds to a simple composition of the circuits. In particular, FAC 0 functions are AC 0 -continuous.

Noninversability
We first consider circuits with a pair of inputs u, v , where the represented function is valued v on u if the circuit accepts the pair u, v . By making no syntactic distinction between input and output, any function has the same complexity as its inverse if it is functional. We show that this blurs definability: Proposition 1. There is an AC 0 -continuous transduction in FAC 0 whose inverse is functional and not AC 0 -continuous.
Proof. Consider the minimal, two-state automaton for L = 0 * (a0 * b0 * ) * and turn it into a transducer by letting ν(·, 0) = 0 and ν(·, a) = ν(·, b) = 1, and call τ the resulting transduction. The FAC 0 circuit for τ first checks that the input is in L. This can be done as L ∈ AC 0 , a fact that can be seen relying on the logical characterization of AC 0 : a word is in L iff its first non-0 letter is an a, its last a b, and the closest non-0 letters to an a (resp. a b) are b's (resp. a's). Next, the circuit simply maps 0 to 0 and a, b to 1. The transduction being in FAC 0 , it is AC 0 -continuous. Now let σ = τ −1 , it is clearly functional. But σ −1 (L) is PARITY, hence σ is not AC 0 -continuous.
Thus, much in the fashion of FAC 0 , this implies that there should be distinguished input and output gates. We next deal with how their lengths are specified.

Output Length as a Parameter
Aiming for a natural and succinct model, we may want that the family of circuits be parametrized solely by the input length. In such a framework, the presented circuit for a given input length is equipped with a way to "deactivate" output gates, in order to allow for different output lengths. Formalizing this idea further, a deactivating circuit C with n inputs and m outputs is an usual circuit with an extra input valued z, a new constant symbol. This new symbol behaves as follows: 1 ∨ z = z ∨ 1 = 1, and any other combination of z with 0, 1, ∨, ∧, ¬ is valued z. The output of C on a given input is its usual output stripped of the z symbol. The frameworks used in [5,10,14] are logic counterparts of this model. Then:

Proposition 2.
There is a transduction expressible as a constant-depth, polysize family of deactivating circuits which is not AC 0 -continuous.
Proof. The erasing morphism 0 → ε, 1 → 1 is a transduction τ that can be expressed as a family of circuits as in the statement of the Proposition, but We thus reach the following definition, that will serve as a basis for our study:

Definition 1 (Functional Circuits).
A function τ : Σ * → T * is expressed as a circuit family (C n m ) n,m≥0 , where C n m is a circuit with n inputs and m + 1 outputs, if: Remark 1.
-Any function τ in FAC 0 v (V) is such that n → max u∈Σ n |τ (u)| has value in N, that is, for a given input size, there is a finite number of possible output sizes. More precisely, this mapping is polynomially bounded. We show this implies that τ is AC 0 (V)-continuous. Let (C n m ) n,m≥0 be the circuit family for τ . Given a language L in AC 0 (V) expressed by the circuit family (D n ) n>0 , τ −1 (L)∩Σ n is recognized by the circuit that applies a polynomial number of circuits C n m to the input, and checks that the only m such that C n m outputs (v, 1) is such that v ∈ D m . -If for any n there is an m such that τ (Σ n ) ⊆ Σ m , i.e., if τ is not of variable output length, then τ ∈ FAC 0 v (V) is equivalent to τ ∈ FAC 0 (V). -We will be interested in functions from Σ * to N, and will speak of their circuit definability. In this context, the function is either seen as taking value in {1} * , and dealt with using a variable-output-length circuit, or taking value in {0, 1} * using an FAC 0 -like circuit, the output value then corresponding to the position of the last 1 in the output. These two views are equivalent, and hence we do not rely on a specific one. We note that (general) transductions from Σ * to {1} * have been extensively studied in [7]; therein, Choffrut and Schützenberger show that such a function is a transduction iff it has a strong form of uniform continuity, akin to the one presented in the introduction, with longest common subwords instead of prefixes.

Separability, Definability, and Lm-Varieties of Stamps
Recall that the transition monoid of an automaton A is the monoid under composition consisting of the functions f w : Q → Q defined by f w (q) = δ(q, w). Historically, regular languages were studied through properties of the transition monoids of their minimal automata (the so-called syntactic monoids). As previously mentioned, the minimal automata for EVEN ∈ AC 0 and PARITY / ∈ AC 0 have the same transition monoid, hence the class AC 0 ∩ REG admits no syntactic monoid characterization. Starting with [2], the interest shifted to transition morphisms of automata, i.e., the surjective morphisms ϕ : w → f w . It is indeed shown therein that a regular language is in AC 0 iff ϕ(Σ s )∪{ϕ(ε)} is an aperiodic monoid for some s > 0 and ϕ associated with the minimal automaton.
A stamp is a surjective morphism from a free monoid to a finite monoid. A systematic study of the classes of languages described by stamps turned out to be a particularly fruitful research endeavor of the past decade [6,9,15,18]. Our use of this theory will however be kept minimal, and we will strive to only appeal to it in this section. The goal of the forthcoming Lemma 1 is indeed to express algebraic properties in a language-theoretic framework only.
Given a stamp ϕ : Σ * → M , we say that L is recognized by ϕ if there is a set E ⊆ M such that L = ϕ −1 (E)-in this case, we also say that L is recognized by M , which corresponds to the usual definition of recognition (e.g., [17]). We say that a stamp ϕ : where h : Σ * → T * is an lm-morphism and η : N → M is a partial surjective morphism. The product of two stamps ϕ and ψ with the same domain Σ * is the stamp mapping a ∈ Σ to (ϕ(a), ψ(a)). Finally, an lm-variety of stamps is a class of stamps containing the stamps Σ * → {1} and closed under lm-division and product. An Eilenberg theorem holds for lm-varieties: there is a one-to-one correspondence between lm-varieties of stamps and the lm-varieties of languages they recognize [18]. We show: Lemma 1. Let A be an automaton, V an lm-variety of stamps, and V its corresponding lm-variety of languages. The following are equivalent: . This is immediate, as L(A, q) separates q from any other state. (iii) → (i). Write L q,q for the language separating q from q . As each of these are recognized by stamps in V and V is closed under product, the language L q = ∩ q =q L q,q is also recognized by a stamp in V. Similarly, taking the product of the stamps recognizing the different L q 's, we see that all of the L q 's are recognized by the same stamp ψ : Σ * → N in V; let thus E q be such that L q = ψ −1 (E q ). Let ϕ : Σ * → M be the transition morphism of A. We claim that ϕ lm-divides ψ, concluding the proof as V is closed under lm-division. Define η : N → M by η(ψ(w)) = ϕ(w). If η is well-defined, then it is a surjective morphism, and we are done as ϕ = η • ψ. Suppose ϕ(u) = ϕ(v), then there is a p ∈ Q such that δ(p, u) = q and δ(p, v) is either undefined or a state q = q. Let w be a word such that δ(q 0 , w) = p, then ψ(wu) ∈ E q and ψ(wv) / ∈ E q , hence ψ(u) = ψ(v), showing that η is well-defined.
Remark 2. For V = QA and V = M sol , the properties of Lemma 1 are decidable.
As advertised, the rest of this paper will now be free from (lm-varieties of ) stamps except for a brief incursion when discussing our results in Sect. 6. Lemma 1 enables a study that stands in the algebraic tradition with no appeal to its tools.

The Transductions in FAC 0 v (V)
In sharp contrast with the work of Reutenauer and Schützenberger [16], we are especially interested in the shape of the outputs of the transduction. It turns out that most of its complexity is given by the following output-length function: Definition 2 (τ # ). Let τ be a transduction. The function τ # : Σ * → N is the output-length function of MinT(τ ) with all the states deemed final. In symbols, τ # (w) = |ν(q 0 , w)|, with MinT(τ ) as the underlying transducer.
Theorem 1. Let τ be a transduction and V be such that AC 0 (V) ∩ REG = V.
The following constitutes a chain of implications: Proof. (i) → (ii). This was alluded to in Remark 1.
(ii) → (iii). This follows from the closure under inverse transductions of REG and the hypothesis that the regular languages of AC 0 (V) are in V.
(iii) → (iv). Let q, q be two states of A = MinT(τ ). We show that we can separate q from q . We distinguish the following cases, that span all the possibilities thanks to the output-minimality of A. In each case, we build a language L separating L(A, q) and L(A, q ), with L ∈ V relying on continuity and on V being an lmvariety by hypothesis. By Lemma 1, we then conclude (iv).
(iv) → (i), assuming τ # ∈ FAC 0 v (V). We construct an FAC 0 v (V) circuit family for τ . Fix an input size n and an output size m. Given an input x = x 1 x 2 · · · x n , we first check, using τ # , that the output length of τ on x is indeed m, and wire this answer properly to the (m + 1)-th output bit. Next, the j-th output bit, 1 ≤ j ≤ m, is computed as follows. We apply τ # to every prefix of x, until we find an i such that τ # (x <i ) < j ≤ τ # (x ≤i ), where x <i = x 1 x 2 · · · x i−1 and similarly for x ≤i . Relying on the languages L(A, q), we find the state q in MinT(τ ) reached by x <i , and let u = ν(q, x i ). The j-th output bit then corresponds to the (j − τ # (x <i ))-th letter of u.
(i) → (τ # ∈ FAC 0 v (V)). Suppose (i), this implies (iv). We construct an FAC 0 (V) circuit family for τ # . Fix the input size n, and let x = x 1 x 2 · · · x n be the input. We can check, using the languages L(MinT(τ ), q), in which state q the word x ends when read. Let w q be a fixed word such that δ(q, w q ) ∈ F , and let r = |ν(q, w q )|. It suffices now to plug the word xw q in the circuit for τ ; the value of τ # (x) is then the length of τ (xw q ) minus r.
Remark 3. The proof of Theorem 1 shows that MinT(τ ), and hence τ # , can be arbitrarily chosen as long as it is output-minimal. The role of τ # is discussed at greater length in Sect. 6.

An Application to AC 0 and ACC 0
Our primary focus is on the decidability of the membership of transductions in small-complexity classes. Theorem 1, while providing a characterization of these transductions, does not come with a decidable property in the general case-even when some conjectured separations are presupposed. With AC 0 and ACC 0 , the functions τ # that can be expressed with circuits can however be characterized.

Definition 3 (Constant Ratio).
A transducer has constant ratio if every two words of the same length looping on a state produce outputs of the same length from this state. In symbols, for any state q and any words u, v of the same length, δ(q, u) = δ(q, v) = q implies |ν(q, u)| = |ν(q, v)|.
We describe the circuit for L for input size n. Let x denote the input. First, the circuit transforms each 0 into u, and each 1 into input. The circuit can be graphically represented as follows: First, the circuit transforms each 0 into u, and each 1 into v-this can be done as |u| = |v|. Then w in is prepended and w out appended to it, and the resulting word x is fed to τ # . The output is in + |x| 0 × u + |x| 1 × v + out , that is: τ # (x ) = in + 1 2 (|x|( u + v ) + (|x| 0 − |x| 1 )( u − v )) + out .