Nathanaël Fijalkow

Hugo Gimbert
email: hugo.gimbert@labri.fr

Youssouf Oualhadj
email: youssouf.oualhadj@labri.fr

Deciding the Value 1 Problem of Probabilistic Leaktight Automata

The value 1 problem is a decision problem for probabilistic automata over finite words: given a probabilistic automaton A, are there words accepted by A with probability arbitrarily close to 1?

This problem was proved undecidable recently. We sharpen this result, showing that the undecidability holds even if the probabilistic automata have only one probabilistic transition.

Our main contribution is to introduce a new class of probabilistic automata, called leaktight automata, for which the value 1 problem is shown decidable (and PSPACE-complete). We construct an algorithm based on the computation of a monoid abstracting the behaviors of the automaton, and rely on algebraic techniques developed by Simon for the correctness proof. The class of leaktight automata is decidable in PSPACE, subsumes all subclasses of probabilistic automata whose value 1 problem is known to be decidable (in particular deterministic automata), and is closed under two natural composition operators.

INTRODUCTION

Probabilistic automata: Rabin invented a very simple yet powerful model of probabilistic machine called probabilistic automata, which, quoting Rabin, "are a generalization of finite deterministic automata" [START_REF] Michael | Probabilistic automata[END_REF]. A probabilistic automaton has a finite set of states Q and reads input words over a finite alphabet A. The computation starts from the initial state i and consists in reading the input word sequentially; the state is updated according to transition probabilities determined by the current state and the input letter. The probability to accept a finite input word is the probability to terminate the computation in one of the final states F ⊆ Q.

From a language-theoretic perspective, several algorithmic properties of probabilistic automata are known: while language emptiness is undecidable [START_REF] Bertoni | The solution of problems relative to probabilistic automata in the frame of the formal languages theory[END_REF], [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF], [START_REF] Paz | Introduction to probabilistic automata[END_REF], language equivalence is decidable [START_REF] Cortes | Lp distance and equivalence of probabilistic automata[END_REF], [START_REF] Schützenberger | On the definition of a family of automata[END_REF], [START_REF] Tzeng | A polynomial-time algorithm for the equivalence of probabilistic automata[END_REF] as well as other properties [START_REF] Condon | On the complexity of space bounded interactive proofs (extended abstract)[END_REF], [START_REF] Cortes | On the computation of the relative entropy of probabilistic automata[END_REF].

Rather than formal language theory, our initial motivation for this work comes from control and game theory: we aim at solving algorithmic questions about partially observable Markov decision processes and stochastic games. For this reason, we consider probabilistic automata as machines controlled by a blind controller, who is in charge of choosing the sequence of input letters in order to maximize the acceptance probability. While in a fully observable Markov decision process the controller can observe the current state of the This work was supported by French CNRS-PEPS Project "Stochastic Games and Verification". process to choose adequately the next input letter, a blind controller does not observe anything and its choice depends only on the number of letters already chosen. In other words, the strategy of a blind controller is an input word of the automaton.

The value of a probabilistic automaton: With this gametheoretic interpretation in mind, we define the value of a probabilistic automaton as the supremum of acceptance probabilities over all input words, and we would like to compute this value. Unfortunately, as a consequence of an undecidability result due to Paz, the value of an automaton is not computable in general. However, the following decision problem was conjectured by Bertoni to be decidable [START_REF] Bertoni | The solution of problems relative to probabilistic automata in the frame of the formal languages theory[END_REF]:

Value 1 problem: Given a probabilistic automaton, does the automaton have value 1? In other words are there input words whose acceptance probability is arbitrarily close to 1?

Actually, Bertoni formulated the value 1 problem in a different yet equivalent way: "Is the cut-point 1 isolated or not?". There is actually a close relation between the value 1 problem and the notion of isolated cut-point introduced by Rabin in the very first paper about probabilistic automata. A real number 0 ≤ λ ≤ 1 is an isolated cut-point if there exists a bound ǫ > 0 such that the acceptance probability of any word is either greater than λ + ǫ or smaller than λ -ǫ. A theorem of Rabin states that if the cut-point λ is isolated, then the language L λ = {w | P A (w) ≥ λ} is regular [START_REF] Michael | Probabilistic automata[END_REF]. The value 1 problem can be reformulated in term of isolated cutpoint: an automaton has value 1 if and only if 1 is not an isolated cut-point. Bertoni proved that for λ strictly between 0 and 1, the isolation of λ is undecidable in general, and left the special case λ ∈ {0, 1} open.

Recently, the second and third authors of the present paper proved that the value 1 problem is undecidable [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF] as well. However, probabilistic automata, and more generally partially observable Markov decision processes and stochastic games, are a widely used model of probabilistic machines used in many fields like software verification [START_REF] Baier | On decision problems for probabilistic Büchi automata[END_REF], [START_REF] Chatterjee | Algorithms for omega-regular games of incomplete information[END_REF], image processing [START_REF] Culik | Digital images and formal languages[END_REF], computational biology [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF] and speech processing [START_REF] Mohri | Finite-state transducers in language and speech processing[END_REF]. As a consequence, it is crucial to understand which decision problems are algorithmically tractable for probabilistic automata.

Our result: As a first step, we sharpen the undecidability result: we prove that the value 1 problem is undecidable even for probabilistic automata with only one probabilistic transition. This result motivated the introduction of a new class of probabilistic automata, called leaktight automata, for which the value 1 problem is decidable. This subclass subsumes all known subclasses of probabilistic automata sharing this decidability property and is closed under parallel composition and synchronized product. Our algorithm to decide the value 1 problem computes in polynomial space a finite monoid whose elements are directed graphs and checks whether it contains a certain type of elements that are value 1 witnesses.

Related works: The value 1 problem was proved decidable for a subclass of probabilistic automata called ♯-acyclic automata [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF]. Since the class of ♯-acyclic automata is strictly contained in the class of leaktight automata, the result of the present paper extends the decidability result of [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF]. Chadha et al. [START_REF] Chadha | Power of randomization in automata on infinite strings[END_REF] recently introduced the class of hierarchical probabilistic automata, which is also strictly contained in the class of leaktight automata. As a consequence of our result, the value 1 problem is decidable for hierarchical probabilistic automata. Our proof techniques totally depart from the ones used in [START_REF] Chadha | Power of randomization in automata on infinite strings[END_REF], [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF]. Instead, we make use of algebraic techniques and in particular Simon's factorization forest theorem, which was successfully used to prove the decidability of the boundedness problem for distance automata [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF].

Outline: We give the basic definitions in Section I. As a first step we present our algorithm to decide the value 1 problem of probabilistic leaktight automata in Section II, which is followed by the decidability of the leaktight property in Section III. Next, in Section IV, we present and prove the technical core of the paper, called the lower bound lemma. Finally, Section V investigates properties and provides examples of leaktight automata. The proofs can be found in the appendix.

I. DEFINITIONS

A. Probabilistic automata

Let Q be a finite set of states. A probability distribution over Q is a row vector δ of size |Q| whose coefficients are real numbers from the interval [0, 1] and such that q∈Q δ(q) = 1. A probabilistic transition matrix M is a square matrix in [0, 1] Q×Q such that every row of M is a probability distribution over Q.

Definition 1 (Probabilistic automata). A probabilistic automaton

A is a tuple (Q, A, (M a ) a∈A , i, F ), where Q is a finite set of states, A is the finite input alphabet, (M a ) a∈A are the probabilistic transition matrices, i ∈ Q is the initial state and F ⊆ Q is the set of accepting states.

For each letter a ∈ A, M a (s, t) is the probability to go from state s to state t when reading letter a. Given an input word w ∈ A * , we denote by w(s, t) the probability to go from state s to state t when reading the word w.

Formally, if w = a 1 a 2 • • • a n then w(s, t) = (M a1 • M a2 • • • M an )(s, t).
Note that 0 ≤ w(s, t) ≤ 1, for all words w and states s and t.

Furthermore, the definition of a probabilistic transition matrix implies that: t∈Q w(s, t) = 1 for all states s.

Definition 2 (Value and acceptance probability). The acceptance probability of a word

w ∈ A * by A is P A (w) = f ∈F w(i, f
). The value of A, denoted val(A), is the supremum of the acceptance probabilities over all possible input words: val(A) = sup

w∈A * P A (w) . (1)

B. The value 1 problem for probabilistic automata

We are interested in the following decision problem:

Problem (Value 1 Problem). Given a probabilistic automaton A, decide whether val(A) = 1.
The value 1 problem can be reformulated using the notion of isolated cut-point introduced by Rabin in his seminal paper [START_REF] Michael | Probabilistic automata[END_REF]: an automaton has value 1 if and only if the cutpoint 1 is not isolated.

Whereas the formulation of the value 1 problem only relies qualitatively on the asymptotic behavior of probabilities (the probability to be in non-final states should be arbitrarily small) the answer to the value 1 problem depends quantitatively on the transition probabilities. For instance, the automaton depicted on Fig. 1 has value 1 if and only if x > 1 2 and has value less or equal than 1 2 otherwise, see also [START_REF] Baier | On decision problems for probabilistic Büchi automata[END_REF], [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF] for similar results. Note that in this example, the value is a discontinuous function of the transition probabilities. The input alphabet is A = {a, b}, the initial state is the central state 0 and the unique final state is ⊤. In order to maximize the probability to reach ⊤, playing two b's in a row is certainly not a good option because from state 0 this ensures to reach the non-accepting absorbing state ⊥ with probability at least 1 2 . A smarter strategy consists in playing one b, then long sequences of a's followed by one letter b. If x ≤ 1 2 , there is still no hope to have a word accepted with probability strictly greater than 1 2 : starting from 0, and after a b and a sequence of a's, the probability to be in R is greater or equal than the probability to be in L, thus playing ba n b from state 0 the probability to reach the sink ⊥ is greater or equal than 2 the probability to reach the final state ⊤. However, if x > 1 then a simple calculation shows that the probability to accept (ba n ) n tends to 1 as n goes to infinity.

0 L ⊤ R ⊥ a b, 1 2 a, 1 -x b a, x a, b b, 1 2 a, x b a, 1 -x a, b

C. Undecidability in a very restricted case

As a first step we refine the undecidability result: we show that the value 1 problem is undecidable even when restricted to probabilistic automata having exactly one probabilistic transition. For such automata, there exists exactly one state s and one letter a such that 0 ≤ M a (s, t) < 1 for all t and the remaining transitions are deterministic: for all triple (s ′ , a ′ , t) ∈ S × A × S such that (s ′ , a ′ ) = (s, a) then M a (s ′ , t) ∈ {0, 1}.

The general idea is to simulate any probabilistic automaton A with a probabilistic automaton B which has only one probabilistic transition and such that val(A) = 1 if and only if val(B) = 1.

As a first attempt, we define the automaton B with a larger alphabet: whenever A reads a letter a, then B reads a sequence of actions a corresponding to a, allowing a state-by-state simulation of A. The unique probabilistic transition of B is used to generate random bits for the simulation. However, the automaton B cannot check that the sequences of actions are well-formed and allow for a faithful simulation. Hence we modify the construction, such that to simulate the automaton A on the input word w, the automaton B now reads ( w) n for arbitrarily large n. Each time B reads a word w, it simulates A on w with a small yet positive probability and "delays" the rest of the simulation, also with positive probability. This delay process allows to run on parallel a deterministic automaton which checks that the sequences of actions are well-formed, ensuring a faithful simulation. The complete details can be found in the appendix (see also [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF]).

This undecidability result illustrates that even very restricted classes of probabilistic automata may have an undecidable value 1 problem. In the next section, we introduce a non-trivial yet decidable subclass of probabilistic automata, defined by the leaktight property.

D. Informal description of the leaktight property

One of the phenomena that makes tracking vanishing probabilities difficult are leaks. A leak occurs in an automaton when a sequence of words turns a set of states C ⊆ Q into a recurrence class C on the long run but on the short run, some of the probability of the recurrence class is "leaking" outside the class.

Such leaks occur in the automaton of Fig. 1 with the input sequence (a n b) n∈N . As n grows large, the probability to reach ⊤ and ⊥ while reading the input word a n b vanishes: there are leaks from L to ⊤ and symmetrically from R to ⊥. As a consequence, the real asymptotic behavior is complex and depends on the compared speeds of these leaks.

An automaton without leak is called a leaktight automaton. In the next section we prove that the value 1 problem is decidable when restricted to the subclass of leaktight automata.

The definition of a leaktight automaton relies on two key notions, idempotent words and word-recurrent states.

A finite word u is idempotent if reading once or twice the word u does not change qualitatively the transition probabilities:

Definition 3 (Idempotent words). A finite word

u ∈ A * is idempotent if for every states s, t ∈ Q, u(s, t) > 0 ⇐⇒ (u • u)(s, t) > 0 .
Idempotent words are everywhere: every word, if iterated a large number of times, becomes idempotent. Lemma 1. For every word u ∈ A * , the word u |Q|! is idempotent.

A finite word u induces naturally a finite homogeneous Markov chain, which splits the set of states into two classes: recurrent states and transient states. Intuitively, a state is transient if there is some non-zero probability to leave it forever, and recurrent otherwise; equivalently from a recurrent state the probability to visit it again in the future is one. Definition 4 (Recurrent states). Let u ∈ A * be a finite word. A state s is u-recurrent if it is recurrent in the finite Markov chain M u with states Q and transitions probabilities (u(s, t)) s,t∈Q .

Formally, s in recurrent in M u if for all t in Q, if there is a non-zero probability to reach t from s, then there is a non-zero probability to reach s from t.

In the case of idempotent words, recurrence of a state can be easily characterized: Lemma 2. Let s be a state and u be an idempotent word. Then s is u-recurrent if for every state t, u(s, t) > 0 =⇒ u(t, s) > 0 .

The proof of this lemma follows from the observation that since u is idempotent, there is a non-zero probability to reach t from s if and only if u(s, t) > 0.

The formal definition of a leak is as follows:

Definition 5 (Leaks and leaktight automata). A leak from a state r ∈ Q to a state q ∈ Q is a sequence (u n ) n∈N of idempotent words such that: 1) for every s, t ∈ Q, the sequence (u n (s, t)) n∈N converges to some value u(s, t). We denote by M u the Markov chain with states Q and transition probabilities (u(s, t)) s,t∈Q , 2) the state r is recurrent in M u , 3) for all n in N, u n (r, q) > 0, 4) and r is not reachable from q in M u . A probabilistic automaton is leaktight if it has no leak.

The automaton depicted in Fig. 1 is not leaktight when 0 < x < 1 because the sequence (u n ) n∈N = (a n b) n∈N is a leak from L to ⊤, and from R to ⊥. The limit Markov chain M u sends state 0 to states L and R with probability 1 2 each, and all other states are absorbing (i.e loop with probability 1). In particular, state L is recurrent in M u , for every n, u n (L, ⊤) > 0 but there is no transition from ⊤ to L in M u .

Several examples of leaktight automata are given in Section V.

II. THE VALUE 1 PROBLEM IS DECIDABLE FOR LEAKTIGHT

AUTOMATA

In this section we establish our main result: Theorem 1. The value 1 problem is decidable for leaktight automata.

A. The Markov monoid algorithm

Our decision algorithm for the value 1 problem computes iteratively a set G of directed graphs called limit-words. Each limit-word is meant to represent the asymptotic effect of a sequence of input words, and some particular limit-words can witness that the automaton has value 1.

Algorithm 1 The Markov monoid algorithm.

Input: A probabilistic automaton A. Output: Decide whether A has value In the rest of the section, we explain the algorithm in details.

1 or not. 1 G ← {a | a ∈ A} ∪ {1}. 2 repeat 3 if there is u, v ∈ G such that u • v / ∈ G then 4 add u • v to G 5 if there is u ∈ G such that u = u • u and u ♯ / ∈ G then 6 add u ♯ to G

Definition 6 (Limit-word

). A limit-word is a map u : Q 2 → {0, 1} such that ∀s ∈ Q, ∃t ∈ Q, u(s, t) = 1.
The condition expresses that our automata are complete: whatever the input word, from any state s there exists some state t which is reached with positive probability. A limit-word u can be seen as a directed graph with no dead-end, whose vertices are the states of the automaton A, where there is an edge from s to t if u(s, t) = 1.

Initially, G only contains those limit-words a that are induced by input letters a ∈ A, where the limit-word a is defined by: ∀s, t ∈ Q, (a(s, t) = 1 ⇐⇒ a(s, t) > 0) . plus the identity limit-word 1 defined by (1(s, t) = 1) ⇐⇒ (s = t), which represents the constant sequence of the empty word.

The algorithm repeatedly adds new limit-words to G. There are two ways for that: concatenating two limit-words in G or iterating an idempotent limit-word in G.

Concatenation of two limit-words:

The concatenation of two limit-words u and v is the limit-word u • v such that:

(u • v)(s, t) = 1 ⇐⇒ ∃q ∈ Q, u(s, q) = 1 and v(q, t) = 1 .
In other words, concatenation coincides with the multiplication of matrices with coefficients in the boolean semiring ({0, 1}, ∨, ∧). The concatenation of two limit-words intuitively corresponds to the concatenation of two sequences (u n ) n∈N and (v n ) n∈N of input words into the sequence (u n • v n ) n∈N . Note that the identity limit-word 1 is neutral for the concatenation.

Iteration of an idempotent limit-word: Intuitively, if a limit-word u represents a sequence (u n ) n∈N then its iteration u ♯ represents the sequence u

f (n) n n∈N
for an arbitrarily large increasing function f : N → N.

The iteration u ♯ of a limit-word u is only defined when u is idempotent i.e when u • u = u. It relies on the notion of u-recurrent state.

Definition 7 (u-recurrence). Let u be an idempotent limitword. A state s is u-recurrent if for every state t,

u(s, t) = 1 =⇒ u(t, s) = 1 .
The iterated limit-word u ♯ removes from u any edge that does not lead to a recurrent state:

u ♯ (s, t) = 1 ⇐⇒ u(s, t) = 1 and t is u-recurrent .

B. The Markov monoid and value 1 witnesses

The set G of limit-words computed by the Markov monoid algorithm is called the Markov monoid.

Definition 8 (Markov monoid)

. The Markov monoid is the smallest set of limit-words containing the set {a | a ∈ A} of limit-words induced by letters, the identity limit-word 1, and closed under concatenation and iteration.

Two key properties, consistency and completeness, ensure that the limit-words of the Markov monoid reflect exactly every possible asymptotic effect of a sequence of input words.

Consistency ensures that every limit-word in G abstracts the asymptotic effect of an input sequence.

Definition 9 (Consistency). A set of limit-words

G ⊆ {0, 1} Q 2 is consistent with a probabilistic automaton A if for each limit- word u ∈ G, there exists a sequence of input words (u n ) n∈N such that for every states s, t ∈ Q the sequence (u n (s, t)) n∈N converges and u(s, t) = 1 ⇐⇒ lim n u n (s, t) > 0 . (2)
Conversely, completeness ensures that every input sequence reifies one of the limit-words. Definition 10 (Completeness). A set of limit-words G ⊆ {0, 1} Q 2 is complete for a probabilistic automaton A if for each sequence of input words (u n ) n∈N , there exists u ∈ G such that for every states s, t ∈ Q:

lim sup n u n (s, t) = 0 =⇒ u(s, t) = 0 . ( 3
)
Definition 11 (Value 1 witnesses). Let A be a probabilistic automaton. A value 1 witness is a limit-word u such that for every state s ∈ Q,

u(i, s) = 1 =⇒ s ∈ F . (4)
Thanks to value 1 witnesses, the answer to the value 1 problem can be read in a consistent and complete set of limitwords: Lemma 3 (A criterion for value 1). Let A be a probabilistic automaton and G ⊆ {0, 1} Q 2 be a set of limit-words. Suppose that G is consistent with A and complete for A. Then A has value 1 if and only if G contains a value 1 witness.

In order to illustrate the interplay between limit-words of the Markov monoid and sequences of input words, we give a detailed proof of Lemma 3.

Proof: Assume first that A has value 1. By definition, there exists a sequence (u n ) n∈N of input words such that

P A (u n ) -→ n 1. As a consequence, f ∈F u n (i, f ) = P A (u n ) -→ n 1. Since for all n ∈ N, we have q∈Q u n (i, q) = 1, then for all s ′ / ∈ F , u n (i, s ′ ) -→ n 0.
Since G is complete, there exists a limit-word u such that (3) holds. Then u is a value 1 witness: for every

s ∈ Q such that u(i, s) = 1, equation (3) implies lim sup n u n (i, s) > 0, hence s ∈ F .
Conversely, assume now that G contains a value 1 witness u. Since G is consistent, there exists a sequence (u n ) n∈N such that (2) holds. It follows from ( 2) and [START_REF] Chalopin | On factorization forests of finite height[END_REF], that for all s ∈ F , we have u n (i, s) -→ n 0.

Thus P A (u n ) = f ∈F u n (i, f ) -→ n 1 and A has value 1.
The following theorem proves that the Markov monoid of a leaktight automaton is consistent and complete, thus according to Lemma 3 it can be used to decide the value 1 problem.

Theorem 2. The Markov monoid associated with an automaton A is consistent. Moreover if A is leaktight then the Markov monoid is complete.

The proof of the second part of this theorem relies on a subtle algebraic argument based on the existence of factorization forests of bounded height [START_REF] Simon | Factorization forests of finite height[END_REF]. The same kind of argument was used by Simon to prove the decidability of the boundedness problem for distance automata [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF].

We postpone the proof of completeness to the next section, where a slightly more general result is established; for now we show that the Markov monoid is consistent.

Lemma 4 (Consistency). Let G ⊆ {0, 1} Q 2 be a set of limit- words. Suppose that G is consistent. Then for every u, v ∈ G the set G ∪ {u • v} is consistent. If moreover u is idempotent then G ∪ {u ♯ } is consistent as well.
The proof uses the notion of reification. Definition 12. A sequence (u n ) n∈N of input words reifies a limit-word u if for every states s, t the sequence (u n (s, t)) n∈N converges and u(s, t) = 1 ⇐⇒ lim n u n (s, t) > 0 .

(5)

In particular, a set of limit-words G is consistent for A if each limit-word in G is reified by some sequence of input words.

Proof: Let u, v ∈ G. We build a sequence (w n ) n∈N which reifies u • v. By induction hypothesis on u and v, there exists (u n ) n and (v n ) n which reify u and v respectively. Let

w n = u n • v n . Then (w n ) n∈N reifies u • v, because w n (s, r) = t∈Q u n (s, t) • v n (t, r)
and by definition of the concatenation of two limit-words.

Suppose now that u is idempotent, we build a sequence (z n ) n∈N which reifies u ♯ . By induction hypothesis, there exists a sequence (u n ) n∈N which reifies u. For every states s, t we denote by u(s, t) the value lim n u n (s, t). Since u is idempotent, the Markov chain M u with state space Q and transition probabilities (u(s, t)) s,t∈Q is 1-periodic thus aperiodic. According to standard results about finite Markov chains, the sequence of matrices (u k ) k∈N has a limit z ∈ [0, 1] Q×Q such that transient states of M u have no incoming edges in z. This implies:

∀s, t ∈ Q, (z(s, t) > 0 =⇒ t is z-recurrent) . (6)
Since (u n ) n∈N converges to u and by continuity of the matrix product, for every k ∈ N the sequence of matrices

(u k n ) n∈N converges to u k . It follows that there exists φ(k) ∈ N such that ||u k -u k φ(k) || ∞ ≤ 1 k . As a consequence the sequence of matrices (z n ) n∈N = (u n φ(n) ) n∈N converges to z. Now we prove that (z n ) n∈N reifies u ♯ because, u ♯ (s, t) = 1 ⇐⇒ t is u-recurrent and u(s, t) = 1 ⇐⇒ t is u-recurrent and u(s, t) > 0 ⇐⇒ t is z-recurrent and z(s, t) > 0 ⇐⇒ z(s, t) > 0 ⇐⇒ lim n z n (s, t) > 0 ,
where the first equivalence is by definition of the iteration, the second holds because (u n ) n∈N reifies u, the third because the iterated Markov chain induced by z = lim k u k has the same recurrent states than the Markov chain M u , the fourth holds by [START_REF] Colcombet | Factorization forests for infinite words and applications to countable scattered linear orderings[END_REF], and the fifth by definition of z.

C. Correctness of the Markov monoid algorithm

Proposition 1. The Markov monoid algorithm solves the value 1 problem for leaktight automata.

Proof: Termination of the Markov monoid algorithm is straightforward because each iteration adds a new element in G and there are at most 2 |Q| 2 elements in G.

The correctness is a corollary of Theorem 2: since the Markov monoid is consistent and complete then according to Lemma 3, A has value 1 if and only if G contains a value 1 witness, if and only if the Markov monoid algorithm outputs "true".

In case the Markov monoid algorithm outputs "true", then for sure the input automaton has value 1. This positive result holds for every automaton, leaktight or not. Proposition 2. If the Markov monoid algorithm outputs "true", the input probabilistic automaton has value 1.

Proof: According to Theorem 2, the Markov monoid is consistent. If it contains a value 1 witness, then according to the second part of the proof of Lemma 3, A has value 1.

In case the Markov monoid algorithm outputs "false" and the automaton is leaktight then the value of the automaton can be bounded from above: Theorem 3. Let A be a probabilistic automaton whose minimal non-zero transition probability is denoted p min . If the Markov monoid algorithm outputs "false" and if moreover A is leaktight, then val(A) ≤ 1 -p 2 3•J 2 min , with J = 2 2|Q| 2 . The proof of this theorem is postponed to the next section, because it relies on the notion of extended Markov monoid, it is actually a direct corollary of the lower bound lemma presented in Section IV.

In case the Markov monoid algorithm outputs "false", one surely wishes to know whether the input automaton is leaktight or not. Fortunately, the leaktight property is decidable, this is the subject of the next section.

D. Complexity of the Markov monoid algorithm Proposition 3. The value 1 problem for leaktight automata is PSPACE-complete.

The Markov monoid algorithm terminates in less than 2 |Q| 2 iterations, since each iteration adds a new limit-word in the monoid and there are less than 2 |Q| 2 different limit-words.

This EXPTIME upper bound can be actually improved to PSPACE. For that we use the same arguments that Kirsten used to prove that limitedness of desert automata can be decided in PSPACE [START_REF] Daniel | Distance desert automata and the star height problem[END_REF].

A way to improve the complexity from EXPTIME to PSPACE is to avoid the explicit computation of the Markov monoid and to look for value 1 witnesses in a non-deterministic way. The algorithm guesses nondeterministically the value 1 witness u and its decomposition by the product and iteration operations. The algorithm computes a ♯-expression, i.e a finite tree with concatenation nodes of arbitrary degree on even levels and iteration nodes of degree 1 on odd levels and labelled consistently by limit-words. The depth of this tree is at most twice the ♯-height (the number of nested applications of the iteration operation) plus 1. The root of the ♯-expression is labelled by u and the expression is computed non-deterministically from the root in a depth-first way.

For desert automata, the key observation made by Kirsten is that the ♯-height is at most |Q|. The adaptation of Kirsten's proof to probabilistic automata relies on the two following lemmata: Lemma 5. Let u and v be two idempotent limit-words. Assume u ≤ J v, then there are less recurrence classes in u than in v. Lemma 6. Let u be an idempotent limit-word. The set of recurrence classes of u is included in the set of recurrence classes of u ♯ . Moreover if u = u ♯ this inclusion is strict.

Since the number of recurrence classes in a limit-word is bounded by |Q|, and if we require the iteration operation to be applied only to unstable idempotent, the ♯-height of a ♯expression is bounded by |Q| thus the depth of the expression is bounded by 2|Q| + 1.

Consequently, the value 1 problem can be decided in PSPACE: to guess the value 1 witness, the non-deterministic algorithm needs to store at most 2|Q| + 1 limit-words which can be done in space O(|Q| 2 ). Savitch's theorem implies that the deterministic complexity is PSPACE as well.

This PSPACE-upperbound on the complexity is tight. The value 1 problem is known to be PSPACE-complete when restricted to ♯-acyclic automata [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF]. The same reduction to the PSPACE-complete problem of intersection of deterministic automata can be used to prove completeness of the value 1 problem for leaktight automata, relying on the facts that deterministic automata are leaktight (Proposition 4) and the class of leaktight automata is closed under parallel composition (Proposition 5). The completeness result is also a corollary of Proposition 4: since ♯-acyclic automata are a subclass of leaktight automata, the decision problem is a fortiori complete for leaktight automata.

III. DECIDING WHETHER AN AUTOMATON IS LEAKTIGHT

At first sight, the decidability of the leaktight property is not obvious: to check the existence of a leak one would need to scan the uncountable set of all possible sequences of input words. Still: Theorem 4. The leaktight property is decidable in polynomial space.

Algorithm 2

The leak-finder algorithm. Input: A probabilistic automaton A. Output: Decide whether A is leaktight or not.

1

G + ← {(a, a) | a ∈ A} ∪ {(1, 1)}. 2 repeat 3 if there is (u, u + ), (v, v + ) ∈ G + such that (u•u, v + • v + ) ∈ G + then 4 add (u • v, u + • v + ) to G + 5 if there is (u, u + ) ∈ G + such that u = u • u and u + = u + • u + and (u ♯ , u + ) ∈ G + then 6 add (u ♯ , u + ) to G + 7 until

return true

The leak-finder algorithm deciding the leaktight property is very similar to the Markov monoid algorithm, except for two differences. First, the algorithm keeps track of those edges that are deleted by successive iteration operations. For that purpose, the algorithm stores together with each limit-word u another limit-word u + to keep track of strictly positive transition probabilities. Second, the algorithm looks for leak witnesses.

Definition 13 (Extended limit-word). An extended limit-word is a pair of limit-words. The set of extended limit-words computed by the leak-finder algorithm is called the extended Markov monoid.

The extended Markov monoid is indeed a monoid equipped with the component-wise concatenation operation:

(u, u + ) • (v, v + ) = (u • v, u + • v + ) ,
It follows that an extended limit-word (u, u + ) is idempotent if both u and u + are idempotent. Definition 14 (Leak witness). An extended limit-word (u, u + ) is a leak witness if it is idempotent and there exists r, q ∈ Q such that:

1) r is u-recurrent, 2) u + (r, q) = 1, 3) u(q, r) = 0.
The correctness of the leak-finder algorithm is a consequence of:

Theorem 5. An automaton A is leaktight if and only if its extended Markov monoid does not contain a leak witness.

The proof can be found in the appendix. Although we chose to present Theorem 2 and Theorem 5 separately, their proofs are tightly linked.

As a consequence, the leaktight property is qualitative: it does not depend on the exact value of transition probabilities but only on their positivity.

IV. THE LOWER BOUND LEMMA

The lower bound lemma is the key to both our decidability result (via Theorem 3) and the characterization of leaktight automata (Theorem 5).

Lemma 7 (Lower bound lemma). Let A be a probabilistic automaton whose extended Markov monoid contains no leak witness. Let p min the smallest non-zero transition probability of A.

Then for every word u ∈ A * , there exists a pair (u, u + ) in the extended Markov monoid such that, for all states s, t ∈ Q,

u + (s, t) = 1 ⇐⇒ u(s, t) > 0 , (7)
u(s, t) = 1 =⇒ u(s, t) ≥ p 2 3•J 2 min , (8)
where J = 2 2|Q| 2 .

To prove Lemma 7, we rely on the notion of Ramseyan factorization trees and decomposition trees introduced by Simon [START_REF] Simon | Factorization forests of finite height[END_REF], [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF].

Definition 15.

Let A be a finite alphabet, (M, •, 1) a monoid and φ : A * → M a morphism. A Ramseyan factorization tree of a word u ∈ A + for φ is a finite unranked ordered tree, whose nodes are labelled by pairs (w, φ(w)) where w is a word in A + and such that:

(i) the root is labelled by (u, φ(u)), (ii) every internal node with two children labelled by (u 1 , φ(u 1 )) and (u 2 , φ(u 2 )) is labelled by (u 1 •u 2 , φ(u 1 • u 2 )), (iii) leaves are labelled by pairs (a, φ(a)) with a ∈ A, (iv) if an internal node t has three or more children t 1 , . . . , t n labelled by (u 1 , φ(u 1 )), . . . , (u n , φ(u n )), then there exists e ∈ M such that e is idempotent and e = φ(u 1 ) = φ(u 2 ) = . . . = φ(u n ). In this case t is labelled by

(u 1 • • • u n , e).
Internal nodes with one or two children are concatenation nodes, the other internal nodes are iteration nodes.

Not surprisingly, every word u ∈ A + can be factorized in a Ramseyan factorization tree, using only concatenation nodes: any binary tree whose leaves are labelled from left to right by the letters of u and whose internal nodes are labelled consistently is a Ramseyan factorization tree. Notice that if u has length n then such a tree has height log 2 (n), with the convention that the height of a leaf is 0. As a consequence, with this naïve factorization of u, the longer the word u, the deeper its factorization tree.

The following powerful result of Simon states that every word can be factorized with a Ramseyan factorization tree whose depth is bounded independently of the length of the word: Theorem 6 ([21], [START_REF] Chalopin | On factorization forests of finite height[END_REF], [START_REF] Colcombet | Factorization forests for infinite words and applications to countable scattered linear orderings[END_REF]). Let A be a probabilistic automaton whose extended Markov monoid contains no leak witness. Every word u ∈ A + has a Ramseyan factorization tree of height at most 3 • |M |.

In [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF], Simon used the tropical semiring (N∪{∞}, min, +) to prove the decidability of the boundedness problem for distance automata. Similarly to the Markov monoid, the tropical semiring is equipped with an iteration operation ♯. Following the proof scheme of Simon, we introduce the notion of decomposition tree relatively to a monoid M equipped with an iteration operation ♯.

Definition 16.

Let A be a finite alphabet, (M, •, 1) a monoid equipped with a function ♯ that maps every idempotent e ∈ M to another idempotent element e ♯ ∈ M and φ : A * → M a morphism. A decomposition tree of a word u ∈ A + is a finite unranked ordered tree, whose nodes have labels in (A + , M ) and such that: i) the root is labelled by (u, u), for some u ∈ M , ii) every internal node with two children labelled by (u 1 , u 1 ) and (u 2 , u 2 ) is labelled by (u 1 • u 2 , u 1 • u 2 ), iii) every leaf is labelled by (a, a) where a is a letter, iv) for every internal node with three or more children, there exists e ∈ M such that e is idempotent and the node is labelled by (u 1 . . . u n , e ♯ ) and its children are labelled by (u 1 , e), . . . , (u n , e). Internal nodes with one or two children are concatenation nodes, the other internal nodes are iteration nodes.

An iteration node labelled by (u, e) is discontinuous if e ♯ = e. The span of a decomposition tree is the maximal length of a path that contains no discontinuous iteration node.

Remark that decomposition and factorization trees are closely related: Lemma 8. A Ramseyan factorization tree is a decomposition tree if and only if it contains no discontinuous iteration nodes.

Proof: The definitions 15 and 16 are similar except for condition iv). If there are no discontinuous nodes then e = e ♯ in iv) of Definition 16.

The following theorem is adapted from [22, Lemma 10] and is a direct corollary of Theorem 6.

Theorem 7.

Let A be a finite alphabet, (M, •, 1) a monoid equipped with a function ♯ that maps every idempotent e ∈ M to another idempotent element e ♯ ∈ M and φ : A * → M a morphism. Every word u ∈ A + has a decomposition tree whose span is less than 3 • |M |.

To obtain the lower bound lemma, we need to bound the depth of a decomposition tree; now that the span is bounded thanks to Theorem 7, we need to bound the number of discontinuous iteration nodes. Simon and Leung noticed that this number is actually bounded by the number of J -classes in the monoid. The notion of J -class of a monoid M is a classical notion in semigroup theory, derived from one of the four Green's relations called the J -preorder: a J -class is an equivalence class for this preorder (for details about Green's relations, see [START_REF] Howie | Fundamentals of semigroup theory[END_REF], [START_REF] Lallement | Semigroups and Combinatorial Applications[END_REF]). The J -preorder between elements of a monoid M is defined as follows:

∀a, b ∈ M, a ≤ J b if a ∈ M bM , where M bM denotes the set {ubv | u, v ∈ M }.
The number of discontinuous nodes along a path in a decomposition tree can be bounded using the following result, adapted from [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF]Lemma 3].

Lemma 9.

Let A be a finite alphabet, and M a monoid equipped with a function ♯ that maps every idempotent e ∈ M to another idempotent element e ♯ ∈ M . Suppose moreover that for every idempotent e ∈ M ,

e ♯ • e = e ♯ = e • e ♯ . ( 9
)
Then for every idempotent element e ∈ M , either e ♯ = e or e ♯ < J e.

As a consequence, the number of discontinuous nodes along a path in a decomposition tree is at most J, where J is the number of J -classes of the monoid. Now we are ready to complete the proof of the lower bound lemma.

Proof of Lemma 7: Let M be the extended Markov monoid G + associated with A and equipped with the concatenation operation:

(u, u + ) • (v, v + ) = (u • v, u + • v + ) ,
and for idempotent pairs the iteration operation:

(u, u + ) ♯ = (u ♯ , u + ) .
Let w ∈ A + . (The case of the empty word is easily settled, considering the extended limit-word (1, 1).) We apply Theorem 7 to the word w, the extended Markov monoid M = G + and the morphism φ : A → M defined by φ(a) = (a, a). According to Theorem 7, w has a decomposition tree T of span less than 3 • |G + |, whose root is labelled by (w, (w, w + )) for some extended limit-word (w, w + ) ∈ G + .

According to the second part of Lemma ( 9), and since there are less J -classes than there are elements in the monoid G + , the depth of T is at most 3

• |G + | 2 . ( 10
)
To complete the proof of Lemma 7, we prove that for every node t labelled (u, (u, u + )) of depth h in the decomposition tree and for all states s, t ∈ Q,

u + (s, t) = 1 ⇐⇒ u(s, t) > 0 , (11) u(s
, t) = 1 =⇒ u(s, t) ≥ p 2 h min . (12)
We prove ( 11) and ( 12) by induction on h. If h = 0 then the node is a leaf, hence u is a letter a and u = u + = a. Then [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF] holds by definition of a and [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF] holds by definition of p min .

For the induction, there are two cases. First case, t is a concatenation node labelled by (u, (u, u + )) with two sons labelled by (u 1 , (u 1 , u +,1 )) and (u 2 , (u 2 , u +,2 )). We first prove that (11) holds. Let s, t ∈ Q such that u + (s, t) = 1. By definition of a decomposition tree, u + = u +,1 • u +,2 . Since u + (s, t) = 1 then by definition of the concatenation there exists q ∈ Q such that u +,1 (s, q) = 1 and u +,2 (q, t) = 1. By induction hypothesis we have u 1 (s, q) • u 2 (q, t) > 0; and since u = u 1 • u 2 then u(s, t) ≥ u 1 (s, q) • u 2 (q, t), which proves the direct implication of [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF]. The converse implication is similar: if u(s, t) > 0 then by definition of matrix product, there exists q ∈ Q such that u 1 (s, q) > 0 and u(q, t) > 0, and we use the induction hypothesis to get u + (s, t) = 1. This concludes the proof of [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF]. Now we prove that (12) holds. Let s, t ∈ Q such that u(s, t) = 1. By definition of a decomposition tree, u = u 1 • u 2 . Since u(s, t) = 1 then by definition of the product of two limit-words there exists q ∈ Q such that u 1 (s, q) = 1 and u

2 (q, t) = 1. Then u(s, t) ≥ u 1 (s, q) • u 2 (q, t) ≥ p 2 h min • p 2 h min = p 2 h+1
min where the first inequality is by definition of the matrix product and the second inequality is by induction hypothesis. This completes the proof of [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF].

Second case, t is an iteration node labelled by (u, (u ♯ , u + )) with k sons t 1 , . . . , t k labelled by (u 1 , (u, u + )), . . . , (u k , (u, u + )). The proof that (11) holds is similar to the concatenation node case (and relies on the fact that u + is idempotent). We focus on the proof of [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF]. Let s, r ∈ Q such that u ♯ (s, r) = 1. By definition of a decomposition tree,

u = u 1 • • • u k . Since t is an iteration node, k ≥ 3 thus: u(s, r) ≥ u 1 (s, r) • q∈Q ((u 2 • • • u k-1 ) (r, q) • u k (q, r)) . (13)
To establish [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF] we prove that:

u 1 (s, r) ≥ p 2 h min , (14)
∀q ∈ Q, (u 2 • • • u k-1 )(r, q) > 0 =⇒ u k (q, r) ≥ p 2 h min . (15
) First we prove [START_REF] Howie | Fundamentals of semigroup theory[END_REF]. Since u ♯ (s, r) = 1 then by definition of the iteration operation, r is u-recurrent and u(s, r) = 1. By induction hypothesis applied to t 1 , according to [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF], it implies u 1 (s, r) ≥ p 2 h min i.e [START_REF] Howie | Fundamentals of semigroup theory[END_REF]. Now we prove [START_REF] Daniel | Distance desert automata and the star height problem[END_REF]. For that we use the hypothesis that (u, u + ) is not a leak witness. Let q ∈ Q such that

(u 2 • • • u k-1 )(r, q) > 0.
Then by induction hypothesis applied to t 2 , . . . , t k-1 , according to [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF], u k-2 + (r, q) = 1. Thus by idempotency of u + , u + (r, q) = 1. Since by hypothesis u ♯ (s, r) = 1 then r is u-recurrent and since (u, u + ) is not a leak witness then necessarily u(q, r) = 1. Thus, by induction hypothesis and according to [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF], u k (q, r) ≥ p 2 h min i.e [START_REF] Daniel | Distance desert automata and the star height problem[END_REF]. Now, putting ( 13), ( 14) and ( 15) altogether,

u(s, r) ≥ u 1 (s, r) • q∈Q (u 2 • • • u k-1 )(r, q) • u k (q, r) ≥ p 2 h min • q∈Q (u 2 • • • u k-1 )(r, q) • p 2 h min ≥ p 2 h+1
min , where the second inequality holds because

q∈Q (u 2 • • • u k-1
)(r, q) = 1 by basic property of transition matrices. This completes the proof of (12).

To conclude, according to [START_REF] Culik | Digital images and formal languages[END_REF] the depth of a decomposition tree can be bounded by 3 • |G + | 2 , and since G + has less than J = 2 2|Q| 2 elements the depth h is less than 3 • J 2 . Then according to [START_REF] Durbin | Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids[END_REF] and [START_REF] Fijalkow | Pushing undecidability of the isolation problem for probabilistic automata[END_REF] this completes the proof of Lemma 7.

V. A FEW LEAKTIGHT AUTOMATA

In this section, we present several properties and examples of leaktight automata.

A. Two basic examples

The automaton on Fig. 2 is leaktight. Its extended Markov monoid is depicted on the right-hand side (except for the neutral element (1, 1)). Each of the four directed graphs represents an extended limit-word (u, u + ); the edges marked + are the edges that are in u + but not in u.

The initial state of the automaton is state 0, and the unique final state is state 1. This automaton has value 1 and this can be checked using its Markov monoid: there is a single value 1 witness a ♯ . Notice that the two distinct extended limit-words labelled by a ♯ and b • a ♯ on Fig. 2 correspond to the same limit-word a ♯ . The automaton on Fig. 3 is leaktight. The initial state of the automaton is state 0, and the unique final state is state F . The Markov monoid has too many elements to be represented here. This automaton does not have value 1.

B. The class of leaktight automata is rich and stable

The class of leaktight automata contains all known classes of probabilistic automata with a decidable value 1 problem, in particular hierarchical automata defined in [START_REF] Chadha | Power of randomization in automata on infinite strings[END_REF] and ♯-acyclic automata defined in [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF].

Proposition 4. Deterministic automata, hierarchical probabilistic automata and ♯-acyclic automata are leaktight and these inclusions are strict.

Another interest of the class of leaktight automata is its stability under two natural composition operators: parallel composition and synchronized product. An automaton A||B is the parallel composition of two automata A and B if its state space is the disjoint union of the state spaces of A and B plus a new initial state. For every input letter, the possible successors of the initial state are itself or one of the initial state of A and B. An automaton A × B is the synchronized product of two automata A and B if its state space is the cartesian product of the state spaces of A and B, with induced transition probabilities. Proposition 5. The leaktight property is stable by parallel composition and synchronized product.

C. About ♯-height

The ♯-height of an automaton is the maximum over all elements u of its Markov monoid of the minimal number of nested applications of the iteration operator needed to obtain u. As already mentioned, an adaptation of a result by Kirsten (Lemma 5.7 in [START_REF] Daniel | Distance desert automata and the star height problem[END_REF]) shows that the ♯-height of an automaton is at most |Q|. A natural question is whether this bound is tight. The answer is positive, a simple computation shows that the only value 1 witness of the automaton of Fig. 4 is

u = (• • • ((a ♯ 0 a 1 ) ♯ a 2 ) ♯ a 3 ) ♯ • • • a n-1 ) ♯ , whose ♯-height is n = |Q| -2. 0 1 2 n -1 n ⊥ a 0 , 1 2
(a i ) i≥0 (a i ) i≤0 (a i ) i≤1 (a i ) i≤n-2 (a i ) i≥0 a 0 , 1 2 a 1 , 1 2 a 1 , 1 2 a 2 , 1 2 a 2 , 1 2 a n-1 , 1 2 a n-1 , 1 2 (a i ) i≥1 (a i ) i≥2 (a i ) i≥3 (a i ) i≥n .
. The following proposition shows a crucial difference between leaktight automata and ♯-acyclic automata. Proposition 6. Deterministic automata and ♯-acyclic automata have ♯-height 1.

CONCLUSION

We introduced a subclass of probabilistic automata, called leaktight automata, for which we proved that the value 1 problem is PSPACE-complete.

In the present paper we considered automata over finite words. Next step is the adaptation of our results to infinite words and probabilistic Büchi automata [START_REF] Baier | On decision problems for probabilistic Büchi automata[END_REF], [START_REF] Chadha | Power of randomization in automata on infinite strings[END_REF], as well as partially observable Markov decision processes.

A natural question is "what does the Markov monoid say about a probabilistic automaton (leaktight or not)?". Since the Markov monoid is independent of the actual values of transition probabilities (only positivity matters), this suggests the two following questions. Given a probabilistic automaton whose transition probabilities are unspecified (only positivity is specified), 1) is it decidable whether the answer to the value 1 problem is the same for any choice of transition probabilities?

2) does the Markov monoid contain a value 1 witness if and only if the automaton has value 1 for some choice of transition probabilities? The first question, suggested by a referee of the present paper, is open, while the answer to the second question seems to be negative.

UNDECIDABILITY IN A VERY RESTRICTED CASE

In this section we sharpen the undecidability result of the value 1 problem to probabilistic automata having only one probabilistic transition.

We say that a probabilistic automaton is simple if for all letters a, for all states s and t, we have M a (s, t) ∈ {0, 1 2 , 1}. According to [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF], the value 1 problem is undecidable for simple probabilistic automata. We first show how to simulate a (simple) probabilistic automaton with one having only one probabilistic transition, up to a regular language: Proposition 7. Given a simple probabilistic automaton A = (Q, A, (M a ) a∈A , q 0 , F ), there exists a simple probabilistic automaton B over a new alphabet B, with one probabilistic transition, and a morphism : A * -→ B * such that: ∀w ∈ A * , P A (w) = P B ( w).

The morphism will not be onto, so this simulation works up to the regular language A * = { w | w ∈ A * }. We shall see that the automaton B will not be able to check that a word read belongs to this language, which makes this restriction unavoidable in this construction.

We first give the intuitions behind the construction. Intuitively, while reading the word w, the probabilistic automaton A "throw parallel threads". A computation of A over w can be viewed as a tree, where probabilistic transitions correspond to branching nodes. On the figure, reading a from q 0 or b from q 1 leads deterministically to the next state. Reading b from q 2 leads at random to r or to s, hence the corresponding node is branching. Our interpretation is that two parallel threads are thrown. Let us make two observations:

• threads are not synchronized: reading the fourth letter (an a), the first thread leads deterministically to the next state, while the second thread randomizes; • threads are merged so there are at most n = |Q| parallel threads: whenever two threads synchronize to the same state q, they are merged. This happens in the figure after reading the fifth letter (b). The automaton B we construct will simulate the n threads from the beginning, and take care of the merging process each step.

Proof: We denote by q i the states of A, i.e Q = {q 0 , . . . , q n-1 }. The alphabet B is made of two new letters ' * ' and 'merge' plus, for each letter a ∈ A and state q ∈ Q, two new letters check(a, q) and apply(a, q), so that:

B = { * , merge} ∪ a∈A,q∈Q
{check(a, q), apply(a, q)} We now define the automaton B. We duplicate each state q ∈ Q, and denote the fresh copy by q. Intuitively, q is a temporary state that will be merged at the next merging process. States in B are either a state from Q or its copy, or one of the three fresh states s * , s 0 and s 1 .

The initial state remains q 0 as well as the set of final states remains F . The transitions of B are as follows:

• for every letter a ∈ A and state q ∈ Q, the new letter check(a, q) from state q leads deterministically to state s * i.e M check(a,q) (q) = s * , • the new letter * from state s * leads with probability half to s 0 and half to s 1 , i.e M s * ( * ) = 1 2 s 0 + 1 2 s 1 (this is the only probabilistic transition of B);

• the new letter apply(a, q) from states s 0 and s 1 applies the transition function from q reading a: if the transition M a (q) is deterministic, i.e M a (q, r) = 1 for some state r then M apply(a,q) (s 0 ) = r and M apply(a,q) (s 1 ) = r, else the transition M a (q) is probabilistic i.e M a (q) = 1 2 r + 1 2 r ′ for some states r, r ′ , then M apply(a,q) (s 0 ) = r and M apply(a,q) (s 1 ) = r′ ; • the new letter merge activates the merging process: it consists in replacing q by q for all q ∈ Q. Whenever a couple (letter, state) does not fall in the previous cases, it has no effect. The gadget simulating a transition is illustrated in the figure .  Now we define the morphism : A * -→ B * by its action on letters: a = check(a, q 0 ) • * • apply(a, q 0 ) . . . check(a, q n-1 ) • * • apply(a, q n-1 ) • merge.

The computation of A while reading w in A * is simulated by B on w, i.e we have:

P A (w) = P B ( w)
This completes the proof. Let us remark that B is indeed unable to check that a letter check(a, q) is actually followed by the corresponding apply(a, q): in-between, it will go through s * and "forget" the state it was in.

We now improve the above construction: we get rid of the regular external condition. To this end, we will use probabilistic automata whose transitions have probabilities 0, 1 3 , 2 3 or 1. This is no restriction, as stated in the following lemma: Lemma 12. For any simple probabilistic automaton A = (Q, A, (M a ) a∈A , q 0 , F ), there exists a probabilistic automaton B whose transitions have probabilities 0, 1 3 , 2 3 or 1, such that for all w in A * , we have: val(A) = val(B).

Proof: We provide a construction to pick with probability half, using transitions with probability 0, 1 3 , 2 3 and 1. The construction is illustrated in the figure. In this gadget, the only letter read is a fresh new letter ♯. The idea is the following: to pick with probability half r 0 or r 1 , we sequentially pick with probability a third or two thirds. Whenever the two picks are different, if the first was a third, then choose r 0 , else choose r 1 . This happens with probability half each. We easily see that

P A (a 0 • a 1 • . . . a k-1 ) = sup p P B (a 0 • ♯ p • a 1 • ♯ p . . . a k-1 • ♯ p ).
Proposition 8. For any simple probabilistic automaton A = (Q, A, (M a ) a∈A , q 0 , F ), there exists a simple probabilistic automaton B over a new alphabet B, with one probabilistic transition, such that:

val(A) = 1 ⇐⇒ val(B) = 1 .
Thanks to the lemma, we assume that in A, transitions have probabilities 0, 1 3 , 2 3 or 1. The new gadget used to simulate a transition is illustrated in the figure .  The automaton B reads words of the form u 1 • finish • u 2 • finish . . ., where 'finish' is a fresh new letter. The idea is to "skip", or "delay" part of the computation of A: each time the automaton B reads a word u i , it will be skipped with some probability.

Simulating a transition works as follows: whenever in state s * , reading the letter ' * ' leads with probability one third to s 1 , one third to s 0 and one third to w. As before, from s 0 and s 1 , we proceed with the simulation. However, in the last case, we q s * s 0 s 1 r 0 r 1 w to q 0 check(a, q) * finish * * apply(a, q) apply(a, q) Fig. 8. The second gadget.

"wait" for the next letter 'finish' that will restart from q 0 . Thus each time a transition is simulated, the word being read is skipped with probability 1 3 . Delaying part of the computation allows to multiply the number of threads. We will use the accepted threads to check the extra regular condition we had before. To this end, as soon as a simulated thread is accepted in B, it will go through an automaton (denoted C in the construction) that checks the extra regular condition.

Proof: We keep the same notations. The alphabet B is made of three new letters: ' * ', 'merge' and 'finish' plus, for each letter a ∈ A and state q ∈ Q, two new letters check(a, q) and apply(a, q), so that: B = { * , merge, finish} ∪ a∈A,q∈Q {check(a, q), apply(a, q)} We first define a syntactic automaton C. We define a morphism : A * -→ B * by its action on letters: a = check(a, q 0 ) • * • apply(a, q 0 ) . . . check(a, q n-1 ) • * • apply(a, q n-1 ) • merge.

Consider the regular language L = { w • finish | w ∈ A * } * , and C = (Q C , δ C , s C , F C ) an automaton recognizing it.

We now define the automaton B. We duplicate each state q ∈ Q, and denote the fresh copy by q. States in B are either a state from Q or its copy, a state from Q C or one of the four fresh states s * , s 0 , s 1 and wait.

The initial state remains q 0 , and the set of final states is F C . The transitions of B are as follows:

• for every letter a ∈ A and state q ∈ Q, the new letter check(a, q) from state q leads deterministically to state s * i.e M check(a,q) (q) = s * , • the new letter * from state s * leads with probability one third to s * , one third to s 0 and one third to s 1 , i.e M s * ( * ) = 1 3 s * + 1 3 s 0 + 1 3 s 1 (this is the only probabilistic transition of B); • any other letter from state s * leads deterministically to w, i.e M s * ( ) = wait;

• the new letter apply(a, q) from states s 0 and s 1 applies the transition function from q reading a: if the transition M a (q) is deterministic, i.e M a (q, r) = 1 for some state r then M apply(a,q) (s 0 ) = r and M apply(a,q) (s 1 ) = r, else the transition M a (q) is probabilistic i.e M a (q) = 1 2 r + 1 2 r ′ for some states r, r ′ , then M apply(a,q) (s 0 ) = r and M apply(a,q) (s 1 ) = r′ ; • the new letter merge activates the merging process: it consists in replacing q by q for all q ∈ Q;

• the new letter finish from state wait leads deterministically to q 0 ; • the new letter finish from state q in F leads deterministically to s C ;

• the new letter finish from any other state is not defined (there is a deterministic transition to a bottom non-accepting state). Transitions in C are not modified. Whenever a couple (letter, state) does not fall in the previous cases, it has no effect.

We now show that this construction is correct. We first prove that for all w ∈ A * , there exists a sequence of words (w p ) p≥1 such that P A (w) = sup p P B (w p ). The probability to faithfully simulate one transition is 2 3 n . It follows:

δ B (q 0 , ŵ • finish) = 2 3 k P A (w) + 1 - 2 3 k q 0 ,
for some k satisfying n ≤ k ≤ n • |w| (the number k corresponds to the number of transitions followed along a faithful simulation of w). This implies that sup p P B (( w • finish) p ) = P A (w), hence if val(A) = 1, then val(B) = 1.

Conversely, we prove that if val(B) = 1, then val(A) = 1. Let w a word read by B accepted with probability close to 1, we factorize it as follows: w = u 1 • finish • . . . • u k • finish, such that u i does not contain the letter finish. The key observation is that if k = 1, the word w is accepted with probability at most 2 3 . Hence we consider only the case k > 1. We assume without loss of generality that P A (u 1 ) > 0 (otherwise we delete u 1 • finish and proceed). In this case, a thread has been thrown while

Fig. 1 .

 1 Fig. 1. This automaton has value 1 if and only if x > 1 2 .

7

 7 until there is nothing to add 8 if there is a value 1 witness in G then

Fig. 2 .

 2 Fig. 2. A leaktight automaton and its extended Markov monoid.

2 .Fig. 3 .

 23 Fig. 3. A leaktight automaton which does not have value 1.

Fig. 4 .

 4 Fig. 4. A leaktight automaton with value 1 and ♯-height n.

Fig. 5 .

 5 Fig. 5. An example of a computation.

Fig. 6 .

 6 Fig. 6. The first gadget.

Fig. 7 .

 7 Fig. 7. Simulating a half with a third.

  there is nothing to add 8 if there is a leak witness in G + then

	9	return false
	10 else
	11

ACKNOWLEDGMENT

We thank Thomas Colcombet for having pointed us to the work of Leung and Simon, as well as two referees for their careful reading and their constructive comments and help in improving this paper.

APPENDIX TOOL LEMMATA

We start with a few tool lemmata.

Lemma 1 The following two properties hold:

• For every word u ∈ A * , the word u |Q|! is idempotent.

• For every limit-word u ∈ {0, 1} Q 2 , the limit-word u |Q|! is idempotent.

Proof: The second statement implies the first one, so we prove the second one. Let n = |Q| and s, t ∈ Q such that u n! (s, t) = 1. We want to prove that u 2•n! (s, t) = 1. Since u n! (s, t) = 1, there exists q ∈ Q and k, l < |Q| such that u k (s, q) = 1, u n!-k-l (q, q) = 1 and u l (q, t) = 1. Consequently, there exists k ′ < |Q| such that u k ′ (q, q) = 1, and since k ′ |n!, this implies u n! (q, q) = 1, thus u 2•n!-k-l (q, q) = 1 and finally u 2•n! (s, t) = 1.

The proof that u 2•n! (s, t) = 1 implies u n! (s, t) = 1 is similar.

The following lemma provides two simple yet useful properties.

Lemma 10. Let A be a probabilistic automaton. i) Let u be an idempotent limit-word. Then for each state s ∈ Q, there exists t ∈ Q such that u(s, t) = 1 and t is u-recurrent. ii) Let (v, v + ) be an extended limit-word of the extended Markov monoid of A. Then:

Proof: We prove i). Let C ⊆ Q be a strongly connected component of the graph u reachable from s. (Recall that u can be seen as the directed graph whose vertex set is Q and where there is an edge from s to t if u(s, t) = 1.) Then for every t, q ∈ C there exists k and a path t = t 1 , t 2 , . . . , t k = q from t to q in u. Thus, (u k )(t, q) = 1 and since u is idempotent, u(t, q) = 1. Thus, C is a clique of the graph u and all states of C are recurrent. Since C is reachable from s in u, the same argument proves that for every t ∈ C, u(s, t) = 1.

We prove ii). By definition, the extended Markov monoid is the smallest monoid containing {(a, a) | a ∈ A} and (1, 1), stable by concatenation and iteration. Property [START_REF] Lallement | Semigroups and Combinatorial Applications[END_REF] holds for every pair (a, a) where a ∈ A. Moreover this property is stable by concatenation and iteration. This completes the proof. 2 . We first note:

Fix an integer N and consider the following stochastic process: it consists in (at most) N identical rounds. In a round, there are three outcomes: winning with probability p n = 1 2 • x n , losing with probability q n = 1 2 • (1 -x) n , or a draw with probability 1 -(p n + q n ). Once the game is won or lost, it stops, otherwise it goes on to the next step, until the N th round. This stochastic process mimics the probabilistic automaton reading the input word (ba n ) N .

The probability to win is:

We now set N = n. A simple calculation shows that the sequence

x n converges to 0 as n goes to infinity. It follows that the probability to win converges to 1 as n goes to infinity. Consequently:

reading u 1 that reached s C , so the syntactic process started: it follows that u i for i > 1 are in the image of . This implies that the simulation is sound: from w we can recover a word in A * accepted with probability arbitrarily close to 1 by A. This completes the proof. The proposition implies the following corollary: the value 1 problem is undecidable, even for probabilistic automata with only one probabilistic transition.

DECOMPOSITION TREES OF BOUNDED SPAN

Theorem 7 Let A be a finite alphabet, (M, •, 1) a monoid equipped with a function ♯ that maps every idempotent e ∈ M to another idempotent element e ♯ ∈ M and φ : A * → M a morphism. Every word u ∈ A + has a decomposition tree whose span is less than 3 • |M |.

The following proof appeared in [START_REF] Simon | On semigroups of matrices over the tropical semiring[END_REF]; we give it here for the sake of completeness.

Proof: We start by adding a few letters to A. For every idempotent e ∈ M , we add a letter e to the alphabet A, and extend φ by φ(e) = e. We do not lose generality because this operation does not modify the monoid M , and a decomposition tree for a word with letters from the original alphabet cannot use the new letters of the extended alphabet

We proceed by induction on the length of u.

First, if u is a letter a, the decomposition tree whose only node is labelled by (a, φ(a)) has span 1.

Consider now a word u with at least two letters. According to Theorem 6, there exists a Ramseyan factorization tree T u of u of height less than 3 • |M |. According to Lemma 8, this factorization tree is in general not a decomposition tree, except in the very special case where it has no discontinuous nodes. The rest of the proof shows how to transform T u into a decomposition tree of span less than 3 • |M |. The proof technique consists in taking care of the discontinuous nodes of T u in a bottom-up fashion.

If T u has no discontinuous node then it is already a decomposition tree. Moreover its span is equal to its height, which is less than 3 • |M |.

If T u has at least one discontinuous node, let t be such a node with maximal depth. By definition, t has at least three children t 1 , . . . , t k labelled by

e and since t is discontinuous, e = e ♯ . We distinguish two cases.

• Either t is the root of T u . In that case v = u and we can construct directly a decomposition tree T u of u of span less than 3 • |M |. Let T 1 , . . . , T k be the subtrees of T u whose roots are respectively t 1 , . . . , t k . Then, since t is a discontinuous node of maximal depth in T u , each subtree T 1 , . . . , T k contains no discontinuous node at all. Consequently, each subtree T i is a decomposition tree whose span is equal to its height, which is less than 3 • |M | -1. Then a decomposition tree for u is the tree with the root labelled by (u, e ♯ ) and children T 1 , . . . , T k . Since e = e ♯ , the root is discontinuous and the span of this tree is less than 3 • |M |. • Or t is not the root of T u . Since t is labelled by (v, e ♯ ), there exist two words w, w ′ ∈ A + such that u = w • v • w ′ . We replace the subword v in u by the letter e ♯ and obtain the word u ′ = w • e ♯ • w ′ . Since t is a discontinuous node, it is an iteration node and has at least three children, thus v has length at least 3. Thus, u ′ is strictly shorter than u and we can apply the induction hypothesis to u ′ : let T ′ be a decomposition tree for u ′ , whose span is less than 3 • |M |. One of the leaves of T ′ corresponds to the letter e ♯ of u ′ and is labelled by (e ♯ , e ♯ ). We replace this leaf by the decomposition tree T v of v given by induction hypothesis. Since the root of T v is labelled by (v, e ♯ ), we obtain a decomposition tree for u = w • v • w ′ , whose span is less than 3 • |M |. This completes the induction step.

Lemma 9

Let A be a finite alphabet, and M a monoid equipped with a function ♯ that maps every idempotent e ∈ M to another idempotent element e ♯ ∈ M . Suppose moreover that for every idempotent e ∈ M ,

Then for every idempotent element e ∈ M , either e ♯ = e or e ♯ < J e.

As a consequence, the number of discontinuous nodes along a path in a decomposition tree is at most J, where J is the number of J -classes of the monoid.

Proof: We prove the first part of the lemma. Equation [START_REF] Cortes | On the computation of the relative entropy of probabilistic automata[END_REF] implies that e ♯ = e ♯ ee ♯ thus e ♯ ≤ J e. Now, we suppose that e ≤ J e ♯ and prove that e = e ♯ . Since M is finite, we have eDe ♯ . Since e • e ♯ = e ♯ , it follows eRe ♯ . By a dual argument, we have eLe ♯ ; hence eHe ♯ . Both e and e ♯ and idempotents, so according to Green's theorem (see e.g [START_REF] Howie | Fundamentals of semigroup theory[END_REF], Theorem 2.2.5.) e = e ♯ .

The second part of the lemma is an immediate consequence, since the sequence of elements of the monoid labelling a branch of a decomposition tree, starting from the root, is non-decreasing for the J -order and strictly increasing on discontinuous nodes. Indeed, if an internal node has two children labelled by (u 1 , u 1 ) and (u 2 , u 2 ) then by definition of a decomposition tree the node is labelled by

and by definition of the J -order, u 1 • u 2 ≤ J u 1 and u 1 • u 2 ≤ J u 2 . For continuous nodes, the same idempotent labels both the internal node and its children. For discontinuous nodes, the father node is labelled by some idempotent e ♯ and the children by e = e ♯ , and we conclude with supra.

ABOUT THE EXTENDED MARKOV MONOID AND LEAK WITNESSES

Theorem 5 An automaton A is leaktight if and only if its extended Markov monoid contains no leak witness.

The proof is split in two parts, the direct implication (Lemma 13) and the converse implication (Lemma 14). Lemma 13. If the extended Markov monoid of an automaton A contains a leak witness then A has a leak. Proof: Suppose that there is a leak witness (u, u + ) in the extended Markov monoid. By definition of a leak witness, u and u + are idempotent and there exists r, q ∈ Q such that r is u-recurrent, u + (r, q) = 1 and u(q, r) = 0. We prove now that there exists a leak from r to q.

By induction, following the proof of Lemma 4 for each (u, u + ) in the extended Markov monoid, we build a sequence (u n ) n∈N such that for every states s, t ∈ Q the sequence (u n (s, t)) n∈N converges and

To complete the proof, we show that (u n ) n∈N is a leak in A from r to q. According to Definition 5, there are four conditions to be met.

First condition is by hypothesis. Moreover, since u + is idempotent then according to [START_REF] Paz | Introduction to probabilistic automata[END_REF] all the (u n ) n∈N are idempotent. Second, let M u the Markov chain associated with transition probabilities (u(s, t)) s,t∈Q . We prove that r is M u -recurrent. Since r is u-recurrent, and according to [START_REF] Paz | Introduction to probabilistic automata[END_REF], ∀s ∈ Q, u(r, s) > 0 =⇒ u(s, r) > 0. But u is idempotent because u is idempotent and [START_REF] Paz | Introduction to probabilistic automata[END_REF]. Thus according to Lemma 2, r is u-recurrent. Third, we need to prove ∀n ∈ N, u n (r, q) > 0, this holds because of (20) and u + (r, q) = 1. Fourth, we need to prove that r is not reachable from q in M u . Since u = lim n u n and according to (18), u(s, t) = 1 ⇐⇒ u(s, t) > 0, thus accessibility in the directed graph u and in the Markov chain M u coincide. Since u(r, q) = 0 and u is idempotent, r is not accessible from q in u, thus neither accessible in M u .

Lemma 14. If the extended Markov monoid of an automaton A contains no leak witness then A is leaktight.

Proof: By contraposition, suppose there is a leak (u n ) n∈N from a state r to a state q in A, and for each s, t ∈ q, denote u(s, t) the limit of the sequence (u n (s, t)) n∈N and M u the Markov chain induced by (u(s, t)) s,t∈Q . By definition of a leak:

r is not accessible from q in M u .

(

To get to the conclusion, we use the leak (u n ) n∈N to build a leak witness (v, v + ) in the extended monoid G + of A.

The first task is to define the pair (v, v + ). By hypothesis, we can apply the Lemma 7 to each word u n of the leak, which gives for each n ∈ N a pair (u n , u +,n ) ∈ G + such that for all states s, t:

Since the extended Markov monoid is finite, there exists N ∈ N such that:

Then according to Lemma 1, (v, v + ) is idempotent. Note also that according to (24) and since the u n are idempotent (by definition of leaks),

Now, we prove that (v, v + ) is a leak witness. According to i) of Lemma 10, since v is idempotent, there exists r ′ such that v(r, r ′ ) = 1 and r ′ is v-recurrent. By definition of a leak witness, if we prove that (a) v + (r ′ , q) = 1, (b) v(q, r ′ ) = 0 then (v, v + ) is a leak witness.

We first prove (a). Let η = p 2 3•J 2 min and K = |G + |!. Then:

=⇒ ∃l, u l (r ′ , r) > 0 (28) (because r and r ′ are in the same class of u-recurrence)

(according to ( 27)).

Now we prove (b)

. By contradiction, suppose that v(q, r ′ ) = 1. Then:

=⇒ r ′ is reachable from q in M u =⇒ r is reachable from q in M u (according to (28))

which contradicts [START_REF] Tzeng | A polynomial-time algorithm for the equivalence of probabilistic automata[END_REF]. This completes the proof of (b), thus (v, v + ) is a leak witness, which concludes the proof of Lemma 14.

ABOUT ♯-HEIGHT

In this section, we adapt Kirsten's results to show that the ♯-height of an automaton is at most |Q|. The following statements are straightforward translations from [START_REF] Daniel | Distance desert automata and the star height problem[END_REF], we provide them for the sake of completeness.

Consider u an idempotent limit-word. We define ∼ u the relation on Q by i ∼ j if u(i, j) = 1 and u(j, i) = 1. Clearly, ∼ u is symmetric, and since u is idempotent, ∼ u is transitive. If for some i there is a j such that i ∼ u j, then i ∼ u i thanks to u's idempotency. Consequently, the restriction of ∼ u to the set

is reflexive, i.e ∼ u is an equivalence relation on Z u . By equivalence class of ∼ u we mean an equivalence class of ∼ u on Z u . We denote by [i] u the equivalence class of i, and by Cl(u) the set of equivalence classes of ∼.

Lemma 15. The following two properties hold:

• Let u, v be two limit-words and i, j in Q.

• Let u be an idempotent limit-word and i, j in Q. There is some l in Q such that u(i, j) = u(i, l) • u(l, l) • u(l, j).

Proof: The first claim is clear and follows from the equality:

Consider now the second claim. For every k, we have u(i, j)

. By a counting argument, there are 1 ≤ p < q ≤ (n + 1) such that i p = i q . Let l = i p . We have

(l, l) ≥ u(i p , i p+1 ) . . . u(i q-1 , i q ), and u(l, j) = u n+2-q (l, j) ≥ u(i q , i n+2 ) . . . u(i n+1 , i n+2 ) .

Hence, u(i, l) • u(l, l) • u(l, j) ≥ u(i 0 , i 1 ) . . . u(i p-1 , i p ) = u(i, j), and the second claim follows. We construct a partial surjective mapping β : Cl(v) → Cl(u). The mapping β depends on the choice of a and b. For every i, j with i ∼ v i and j ∼ u j satisfying a(j, i)

To complete the proof, we have to show that β is well defined and that β is indeed surjective.

We show that β is well defined. Let i, i ′ such that i ∼ v i and i ′ ∼ v i ′ . Moreover, let j, j ′ such that j ∼ u j and

By symmetry, we achieve u(j ′ , j) = 1, and hence, j ∼ u j ′ .

We show that β is surjective. Let j such that j ∼ u j. We have to exhibit some i such that β(

Lemma 5 Let u be an idempotent limit-word. We have

Assume now u ♯ = u. Let i, j such that u(i, j) = 1 and u ♯ (i, j) = 0. By Lemma 15, there is some l such that u(i, j) = u(i, l) • u(l, l) • u(l, j), so u(l, l) = 1. By contradiction, assume u ♯ (l, l) = 1. Hence,

i.e, u ♯ (i, j) = 1 which is a contradiction. Consequently, u ♯ (l, l) = 0, so l ∼ u l and l ∼ u ♯ l. Thus, l ∈ Z u but l / ∈ Z u ♯ . Hence, there is a class [l] u in Cl(u), but there is no class [l] u ♯ in Cl(u ♯ ). In combination with the first part of this lemma, we obtain Cl(u ♯ ) Cl(u).

A FEW LEAKTIGHT AUTOMATA Proposition 4 Deterministic automata, hierarchical probabilistic automata and ♯-acyclic automata are leaktight.

Proof: It is obvious that deterministic automata are leaktight. We give an algebraic proof. For deterministic automata the iteration operation has no effect on limit-words. As a consequence, the extended Markov monoid only contains pair (u, u) whose both components are equal, and none of them can be a leak witness. The characterization given by Theorem 2, allows us to conclude that deterministic automata are leaktight.

The proof for hierarchical automata is given in Proposition 9.

The proof for ♯-acyclic automata is given in Proposition 10.

Proposition 5

The leaktight property is stable by parallel composition and synchronized product.

Proof: Both cases are proved easily. For the parallel product, let i be the new initial state. If there is a leak in A||B from a state q = i then this a leak either in A or B. There can be no leak (u n ) n∈N from i because i is u-recurrent only for those words u that are written with letters stabilizing i.

For the synchronized product, the extended Markov monoid of the synchronized product A×B is the product of the extended Markov monoids of A and B. If there was a leak in A × B, then according to Theorem 5 there would be a leak witness (u, u + ) = ((u A , u B ), (u +,A , u +,B )) in the extended Markov monoid of A × B from a state (r A , r B ) to a state (q A , q B ). Then r A is u A -recurrent and u +,A (r A , q A ) = 1 thus since A is leaktight u A (q A , r A ) = 1. Similarly, u B (q B , r B ) = 1 thus u((q A , q B ), (r A , r B )) = 1 hence a contradiction.

A. Leaktight automata strictly contain hierarchical automata

The class of hierarchical automata has been defined in [START_REF] Chadha | Power of randomization in automata on infinite strings[END_REF]. The states Q of a hierarchical automaton are sorted according to levels such that for each letter, at most one successor is at the same level and all others are at higher levels. Formally, there is a mapping rank : Q → [1, . . . , l] such that ∀a ∈ A, ∀s, t ∈ Q such that a(s, t) > 0, rank(t) ≥ rank(s) and the set {t | a(s, t) > 0, rank(t) = rank(s)} is either empty or a singleton.

Proposition 9. Every hierarchical automata is leaktight.

Proof: We prove by induction that for every extended limit-word (u, u + ) in the extended Markov monoid of a hierarchical automata, for every state r:

(r is u-recurrent) =⇒ (∀q = r, u + (r, q) = 0) .

Property (29) obviously holds for base elements (a, a). Property (29) is stable by product: let (u, u + ) and (v, v + ) with property (29) and let r ∈ Q be uv-recurrent. By definition of hierarchical automata the recurrence classes of the limit-words u, v and uv are singletons thus r is necessarily both u-recurrent and v-recurrent. According to (29), ∀q = r, u + (r, t) = 0 thus ∀q = r, (u + v + )(r, q) = 0.

Property (29) is obviously stable by iteration, which terminates the proof. The inclusion is strict, an example is given by Fig. 2.

B. Leaktight automata strictly contain ♯-acyclic automata

The class of ♯-acyclic automata has been defined in [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF].

Let A be a probabilistic automaton, to define ♯-acyclic automata, we define an action on non-empty subsets of states. Given S ⊆ 2 Q and a letter a, by definition S • a = {t | ∃s ∈ S, a(s, t) = 1}. If S • a = S, then we define the iteration of a: S • a ♯ = {t | ∃s ∈ S, a ♯ (s, t) = 1}. Consider now the graph whose vertices are non-empty subsets of states and there is an edge from S to T if S • a = T or S • a = S and S • a ♯ = T . The automaton A is ♯-acyclic if the unique cycles in this graph are self loops.

We extend the action on any limit-word: given S ⊆ Q and a limit-word u, by definition S • u = {t | ∃s ∈ S, u(s, t) = 1}.

Proposition 6 Deterministic automata, ♯-acyclic automata and hierarchical automata have ♯-height 1.

Proof: For deterministic automata, this is obvious because there are no unstable idempotent in the Markov monoid so the iteration operation is useless and the ♯-height is actually 0.

For ♯-acyclic automata, this is a corollary of results in [START_REF] Gimbert | Probabilistic automata on finite words: Decidable and undecidable problems[END_REF]: if a ♯-acyclic automaton has value 1 then there exists a sequence of letters a 0 , b 0 , a 1 , . . . , a n , b n , a n+1 ∈ (A ∪ {ǫ}) * such that a 0 b ♯ 0 a 1 b ♯ 1 . . . a n b ♯ n a n+1 is a value 1 witness. Proposition 10. Every ♯-acyclic automata is leaktight.

Proof: We prove that for all extended limit-word (u, u + ), we have (u(s, t) = 0, u + (s, t) = 1) ⇒ s is transient, which implies the leaktight assumption, by induction on u. The case u = a is clear. Consider the case u = v ♯ , and let s, t states such that (u(s, t) = 0, u + (s, t) = 1). Then either (v(s, t) = 0, v + (s, t) = 1) or v(s, t) = 1 and t is transient in v. In the first case, the induction hypothesis ensures that s is transient in v. In the second case, s would be transient in v. In both cases, s is transient in v, so also in u.

Consider now the case u = u 1 • u 2 , and let s, t states such that (u(s, t) = 0, u + (s, t) = 1). Assume toward contradiction that s is recurrent in u. Let C = {q | u(s, q) = 1} be the recurrence class of s, so we have C • u = C. The ♯-acyclicity implies that C • u 1 = C and C • u 2 = C.

There are two cases: either there exists p such that (u 1 (s, p) = 0, u 1+ (s, p) = 1), or such that u 1 (s, p) = 1 and (u 2 (s, p) = 0, u 2+ (s, p) = 1). Consider the first case, and T = C • u ♯ 1 . We have T C, so T • u ♯ = C, which defines a ♯-cycle over C, contradiction. In the second case, let T = C • u ♯ 2 , we have T C so T • u ♯ = C, which defines a ♯-cycle over C, contradiction. This completes the proof.

The inclusion is strict: Fig. 4 provides an example of leaktight automaton which is not ♯-acyclic.