A logical limit law for 231 -avoiding permutations

We prove that the class of 231-avoiding permutations satisfies a logical limit law, i


Background
For any model of random combinatorial structures (e.g., permutations, graphs, . . .), a natural problem is to compute the asymptotic probability that they satisfy a property of interest.A step further consists in considering this problem for general sets of properties.To this end, it is useful to use finite model theory.In this context, the combinatorial objects are seen as models of some logical theory (e.g., graphs are finite sets with a binary symmetric anti-reflexive relation).Then finite model theory allows one to define a whole hierarchy of properties on our object: (existential) first-order properties, (existential/monadic) second order properties, and so on.In this paper, we will be interested in first-order properties, which are the ones that can be written using only quantifiers on elements (and not on sets), equalities between elements, the relation(s) of the language (e.g. two elements being neighbours in graphs) and boolean operations; see below for an informal discussion on the expressive power of first-order logic, and Section 2.1 for a formal definition.
Let us consider a sequence of random combinatorial structures s n , for example graphs or permutations, 2 M. Albert, M. Bouvel, V. Féray and M. Noy seen as models of a logical theory.We say that s n satisfies a (first-order) logical limit law (i) if, for any first-order sentence Ψ, the probability that s n satisfies Ψ, denoted P(s n |= Ψ), has a limit as n tends to +∞.If, additionally, the limit is always 0 or 1, then s n satisfies a (first-order) 0-1 law.This formal logic approach in discrete probability started around 1970 with the seminal works of Glebskij et al. (1969) and Fagin (1976), who independently proved that a uniform random simple graph G n with n vertices satisfies a 0-1 law.More generally, for the Erdős-Rényi model G(n, p) with p ∼ n α (α ∈ (0, 1)), a remarkable result of Shelah and Spencer (1988) states that G(n, p) satisfies a 0-1 law if and only if α is irrational.Recently, a collection of results has appeared regarding existence or non-existence of 0-1/logical limit laws for uniform random graphs taken in a given graph class; see, e.g., Heinig et al. (2018) and Müller and Noy (2018).
For permutations, fewer results of this type are available.Two different ways of seeing permutations as models of some logical theory have been described by Albert et al. (2020).We will focus on the one called TOTO (Theory Of Two Orders), where permutations are seen as finite sets, endowed with a pair of linear orders (A, < P , < V ) (comparing respectively the positions and the values of elements of the permutation; see Section 2.1 for details).With respect to TOTO, it is known that uniform random permutations σ n do not satisfy a logical limit law, i.e. there exist first-order properties Ψ such that P(σ n |= Ψ) does not have a limit (and actually, can be taken to oscillate between 0 and 1); see Foy and Woods (1990) (note that this reference does not use the permutation language, but considers the equivalent setting of pairs of linear orders) or Müller et al. (2023) (where the more general setting of Mallows random permutations is considered).On the opposite, uniform layered permutations (ii) do satisfy a logical limit law Braunfeld and Kukla (2022).
Expressive power of the first-order logic on permutations.To make things more concrete, let us explain informally which kind of properties Ψ can be expressed as a first-order property in the TOTO logic.More details can be found in Albert et al. (2020).The containment of a given pattern, either in the classical or consecutive sense, is a first-order property.One can also consider the generalizations considered in the literature (vincular, bivincular, meshed, barred, decorated patterns); see Albert et al. (2020) for details.This contains many classical statistics on permutations: left-to-right maxima (or other types of records), adjacencies (two elements which are consecutive both in positions and values), indecomposable blocks, . . .For each of these statistics, one can express the fact that a permutation contains exactly/at most/at least k of those (for any fixed k), and any boolean combination of these properties.For example, that a permutation contains at most nine inversions and exactly two adjacencies is a first order property.One can also express properties of the first/last/maximum/minimum of the permutation, e.g., that the minimum of a permutation occurs before its maximum.On the other hand, that a permutation contains an even/odd number of inversions is not a first order property.It is also impossible to consider statistics that compares elements of the domain to elements of the co-domain of the permutations, such as existence of fixed points, exceedances, . . .

Main result
We recall that a permutation σ contains a permutation π as a pattern if there is a subsequence of σ which is order-isomorphic to π.For instance, the permutation 6473512 contains 231 as a pattern: indeed, its (i) In some texts, the name "convergence law" is used instead of "logical limit law". (ii) A permutation is layered if it is an increasing sequence of decreasing runs (of arbitrary length).
subsequence 472 is order-isomorphic to 231.When σ and π are interpreted as models of TOTO, this just means that π is (isomorphic to) a submodel of σ.For a given pattern π, the set of permutations avoiding π is denoted Av(π), and for any integer n, Av n (π) denotes the set of permutations of size n in Av(π).Sets of permutations of the form Av(π), called (principal) permutation classes, have been widely studied in the enumerative combinatorics literature (see Vatter (2015) for a survey) and more recently also from the probabilistic point of view (see, e.g., Bassino et al. (2022) and references therein).In this article we consider one of the simplest nontrivial cases, namely the class Av(231).We prove a logical limit law for a uniform random 231-avoiding permutation σ n of size n.We also provide two additional results on the possible asymptotic behavior of P(σ n |= Ψ), where Ψ a first order sentence on permutations.
Theorem 1 For each n ≥ 1, let σ n be a uniform random 231-avoiding permutation of size n.Then σ n satisfies a logical limit law.Moreover, 1. if Ψ is a first order sentence on permutations, then either lim P(σ n |= Ψ) > 0, or there exists ε = ε(Ψ) < 1 such that 2. the set of limiting probabilities lim The proof of the logical limit law is inspired by a paper of Woods (1997), proving a logical limit law for uniform random nonplane trees in monadic second order logic.It relies on techniques of analytic combinatorics, in particular on a general result on the type of singularity of polynomial systems of equations (commonly known as the Drmota-Lalley-Woods theorem).Item 1 above is a consequence of Woods' proof technique.For the description of the set of limiting probabilities, we exhibit and combine sufficiently many simple events, whose asymptotic limiting probability is straightforward to compute.We then use a lemma of Kakeya (1915), indicating when the set of subsums of a given convergent series is dense in the relevant interval.The second part of our result can be compared to the results of Heinig et al. (2018) and Larrauri et al. (2022), where the set of limiting probabilities is described for some random graph models.At least for Av(231), the picture is simpler in the setting of permutations.
We note that a logical limit law for another permutation class, namely the class of layered permutations has been recently established by Braunfeld and Kukla (2022).The techniques are different from the ones in the present paper.Interestingly, none of these techniques is easily adapted to Av(321) (even though they have the same number of elements of each size, the classes Av(231) and Av(321) are known to have different structures in many ways).We do not know whether Av(321) admits a logical limit law or not (iii) .More generally, it is not known whether there exists a proper permutation class for which the logical limit law fails; see (Braunfeld and Kukla, 2022, Section 5).
What about the TOOB logic?As mentioned above, in Albert et al. (2020), two different ways of seeing permutations as models in some logical theory were considered.In this paper, we only consider one of them, TOTO.The other framework, TOOB (Theory Of One Bijection), regards permutation as maps from a finite set A to itself, and consists of a single relation expressing that an element x is sent to y.In TOOB, one can express condition on cycles of fixed lengths, for example that a permutation has more than three fixed points and at least one cycle of length at least 10.It is however impossible to compare values of the elements; in particular conjugate permutations are indistinguishable for TOOB.
The expressibility of TOOB is in some sense poorer than that of TOTO, and the question of logical limit law is essentially equivalent to the convergence of short cycle counts; see (Müller et al., 2023, Section 4).In particular, it is easy to prove that uniform random permutations satisfy a logical limit law for TOOB; see again (Müller et al., 2023, Section 4).We are not aware of logical limit law results for uniform pattern-avoiding permutations for TOOB.As said above, this amounts to studying their short cycle counts.Fixed points in 213-avoiding (resp.123-avoiding and 321-avoiding (iv) ) permutations have been studied in Hoffman et al. (2017Hoffman et al. ( , 2019)), where convergence in distribution results are proved.We might expect similar results for the number of cycles of length k (for any fixed k) which would imply a logical limit law in these cases, but proving it would require a significant amount of work.

Permutations as models of a logical theory and first order sentences
We present here briefly the logical theory TOTO (theory of two orders).Details and general references for finite model theory can be found in Albert et al. (2020).The signature of the theory consists of two binary relations < P and < V .The axioms of the theory specify that < P and < V are linear (or total) order relations.A model in the theory is then a set A endowed with two linear orders, also denoted < P and < V .We will only be interested here in finite models.As explained in Albert et al. (2020), isomorphism classes of finite models are naturally indexed by permutations.Indeed, think of a permutation as its permutation matrix, where 1s are replaced by points and 0s by empty cells.Then σ can be identified with the sets A σ of points, together with the relations < σ P and < σ V , comparing respectively the x and y-coordinates of points (or in other terms, their positions and their values in the permutation).See Fig. 1 for an example.
We now define first-order formulas and sentences.Take an infinite set {x, y, z, . . .} of variables.Atomic formulas are constructed by taking variables and connecting them with a relation of the signature or with the equality symbol.In our case, examples of atomic formulas are x = z, x < P y or x < V x.
(iv) Unlike TOTO, the TOOB framework is not invariant by the action of all symmetries of the square acting on permutation matrices, and considering 123-avoiding permutations is not equivalent to 321-avoiding permutations.It is however still invariant by symmetries along diagonals, so that considering 213-avoiding or 132-avoiding permutations are equivalent problems.As far as we are aware, fixed points in 231-avoiding, or equivalently in 312-avoiding permutations, have not been studied.
First-order formulas are then obtained inductively from the atomic formulas, as combinations of smaller formulas using the usual connectives of the first-order logic: negation (¬), conjunction (∧), disjunction (∨), implication (⇒), equivalence (⇔), universal and existential quantification (∀x ϕ or ∃x ϕ, where x is a variable and ϕ a formula).A sentence is a formula that has no free variable, that is to say in which all variables are quantified.For example, ∃x ∃y (x < P y ∧ y < V x) is a first order sentence.
First order sentences describe properties of the models, in our case of permutations.We say that a permutation σ satisfies a sentence Ψ, and write σ |= Ψ, if Ψ holds true when the variables are interpreted as elements of A σ and when the symbols < P and < V are interpreted as < σ P and < σ V .For example, σ |= ∃x ∃y (x < P y ∧ y < V x) precisely if σ contains two elements that form a 21 pattern.

Logical types
We start by recalling the notion of quantifier depth of a first-order formula.Informally, this is the maximal number of nested quantifiers in the formula.Formally, we can define it recursively as follows.If Ψ is an atomic formula (such as u = v, x < V y or z < P t), then qd(Ψ) = 0. Otherwise: Fix k ≥ 2 and consider first-order sentences of quantifier depth at most k.We consider two first-order sentences to be equivalent if they are satisfied by the same set of permutations.By putting formulas in, say, prenex conjunctive normal forms, we see that, in any theory with finite signature, for each fixed k ≥ 2, there are finitely many first-order sentences of quantifier depth at most k, up to equivalence.
We say that two permutations σ and τ are k-equivalent, and write σ ≡ k τ , if they are models for the same first-order sentences of quantifier depth k.For each fixed k, this relation splits the set of permutations into finitely many equivalence classes.These classes are called logical types of order k; their set is denoted T k .

Ehrenfeucht-Fraïss é games
We will make use here of a fundamental result of finite model theory, relating satisfaction of first-order sentences to a combinatorial game.We present here this result in the context of permutations (in the TOTO logic).We refer to Albert et al. (2020) for a more detailed specific discussion on permutations and to Grädel et al. (2007) for a general reference on finite model theory.
Let α and β be two permutations, and let k be a positive integer.The Ehrenfeucht-Fraïssé (EF) game of length k played on α and β is a game between two players (named Duplicator and Spoiler) according to the following rules: • The players alternate turns, and Spoiler moves first.
• The game ends when each player has had k turns.
• At his i th turn, (1 ≤ i ≤ k) Spoiler chooses either an element a i ∈ α or an element b i ∈ β.In response, at her i th turn, Duplicator chooses an element of the other permutation.Namely, if Spoiler has chosen a i ∈ α, then Duplicator chooses an element b i ∈ β, and if Spoiler has chosen b i ∈ β, then Duplicator chooses a i ∈ α.
• At the end of the game if the map a i → b i for all i ≤ k preserves both position and value orders, then Duplicator wins.Otherwise, Spoiler wins.
The connection between EF games and quantifier depth is captured in the fundamental theorem of Ehrenfeucht and Fraïssé, which we state here for permutations.
Proposition 2 Two permutations α and β are k-equivalent if and only if Duplicator has a winning strategy in the EF game of length k played on α and β.
We will use this result below to prove that certain operations on permutations affect the logical types in a prescribed manner; see Lemma 4.

Algebraic systems of equations and the Drmota-Lalley-Woods theorem
As mentioned in the introduction, the proof of the logical limit law relies on techniques from analytic combinatorics, which we now introduce.
Consider a system of equations: for 1 ≤ i ≤ d, one has where the y i are unknown formal power series in z and each Φ i is a given formal power series in z, y 1 , • • • , y d with non-negative coefficients.
To such a system, we associate its dependency graph, which is a directed graph on the vertex set {1, • • • , d} with the following edges: there is an edge from i to j if y i appears in the equation defining y j , i.e. if ∂Φj ∂yi ̸ = 0.
We recall that a directed graph is said to be strongly connected if, for any pair of vertices (u, v), there is an oriented path from u to v.In general, one can consider the strongly connected components of a directed graph G.These are maximal induced subgraphs that are strongly connected.A strongly connected component C of G is said to be terminal, if there does not exist v in C and w outside C with an oriented edge from v to w.
Its dependency graph is drawn in Fig. 2. The strongly connected components are represented with a dashed contour, and the terminal one (which is unique in this case) has a light gray background.
Finally, we recall that a series A = n≥0 a n z n is said to be periodic if there exists d ≥ 2 and r such that a n = 0 unless n ∈ dZ + r.It is aperiodic otherwise.
In analytic combinatorics, we are interested in the behavior of generating series of combinatorial objects around their dominant singularities.It turns out that solutions of a system of equations such as (1) have some specific behavior under rather general hypotheses.This is known as the Drmota-Lalley-Woods theorem.We use the standard Kronecker symbol δ i,j defined by δ i,j = 1 if i = j and 0 otherwise.
Proposition 3 Consider a system as in (1), where the Φ i have nonnegative coefficients, and assume that: 1. the system is nonlinear in the y i 's, i.e. there exist indices i, j, k (possibly with repetitions) such that for each i, one has Φ i (0; y 1 , • • • , y d ) = 0 (as power series in y 1 , . . ., y d ); 3. there exist j and k such that Φ j (z; 0, • • • , 0) ̸ = 0 and ∂Φ k ∂z (z; y 1 , • • • , y d ) ̸ = 0 (as power series in z and in z, y 1 , . . ., y d respectively); 4. the dependency graph of the system is strongly connected; 5. each Φ i is convergent for (r, s 1 , • • • , s d ) in a neighbourhood of (0, • • • , 0) and the intersection of their regions of convergence contains a solution (r, 6. at least one of the series y i is aperiodic. Then the system (1) has a unique solution with y 1 (0) = • • • = y d (0) = 0.This solution satisfies that all the y i have the same radius of convergence ρ, which is the first coordinate r of the solution of (2).Moreover, for each i, there is a nonzero constant A i such that Some bibliographic comments are in order.The name Drmota-Lalley-Woods theorem is given in Flajolet and Sedgewick (2009) (see Theorem VII.6 there), but this reference only treats the case of polynomial systems of equations.For the more general case of analytic equations, which we will need in this paper, we refer to (Drmota, 2009, Theorem 2.33).Note that we only consider a special case of (Drmota, 2009, Theorem 2.33), where we do not consider any auxiliary formal variables u i .Also, this reference gives a singular expansion of the generating series y i around the singularity and ensures (in the aperiodic case, as assumed above) the analyticity of y i on a ∆-domain, so we need to apply the so-called transfer theorem (Flajolet and Sedgewick, 2009, Theorem VI.4) to get (3) as above.The fact that A i ̸ = 0 is a consequence of the property h j (x, u) ̸ = 0 given in (Drmota, 2009, Theorem 2.33).
3 Proof of Theorem 1 The goal of this section is to prove Theorem 1, in particular to prove that a logical limit law holds for the class C = Av(231) of 231-avoiding permutations.We use the convention that C contains the empty permutation of size 0.
We first present a standard recursive construction of the elements of C. To this end, recall that the direct sum τ ⊕ π of two permutations τ and π is obtained by juxtaposing τ and π (in one-line notation) and increasing all values in π by the size of τ .The skew sum τ ⊖ π is defined similarly except that, this time, values in τ are shifted by the size of π.For example, 12 ⊕ 231 = 12453, while 12 ⊖ 231 = 45231.It is well-known -see e.g.(Bóna, 2012, Chapter 4) -that a non-empty permutation σ in C can be uniquely decomposed as τ ⊕ (1 ⊖ π), for some (possibly empty) τ and π in C.This yields the following equation for the generating series C(z) = 1 + z C(z) 2 , whose unique non-negative power series solution is given by Therefore, as it is well known, [z n ]C(z) is the n-th Catalan number and one has the asymptotics

Refining the combinatorial equation.
From now on, we fix k ≥ 2. The decomposition σ = τ ⊕ (1 ⊖ π) is compatible with logical types in the following sense.
Lemma 4 Let τ and π be permutations and let t 1 and t 2 be their logical types of order k.Then the logical type of order k of τ ⊕ (1 ⊖ π) depends only on t 1 and t 2 ; we denote it by H k (t 1 , t 2 ).
It is easy to see that this is a winning strategy for Duplicator, proving that σ 1 ≡ k σ 2 . 2 For t a logical type in T k , we write C t for the generating series of 231-avoiding permutations of type t.
We remove from T k the logical types t such that C t ≡ 0. Since t C t (z) = C(z) and since C(z) is convergent at its radius of convergence R = 1/4, all C t (z) are convergent for |z| ≤ 1/4 (but the radius of convergence of some of them might be larger than 1/4).
There is a special element of T k , the type of the empty permutation (which is alone in its class), denoted by ∅.Using Lemma 4, the equation C(z) = 1 + z C(z) 2 can be refined as a system The key point in the proof of the logical limit law in Theorem 1 consists in extracting from this system the asymptotic behavior of the function C t (z).Though far from being explicit, this system has noticeable properties.Let us consider the dependency graph G k of this system of equations.We claim that G k has a unique terminal strongly connected component.Indeed suppose for the sake of contradiction that u 1 and u 2 are elements of two different strongly connected components S and S ′ of G k .Then, letting t = H(u 1 , u 2 ), by construction there is an edge from u 1 to t in G k , as well as an edge from u 2 to t.Since S (resp.S ′ ) is strongly connected, this implies that t is in S (resp. in S ′ ).But t cannot be simultaneously in S and S ′ , whence a contradiction.
Thus G k has a unique terminal strongly connected component, which we denote G ⋆ k .We let T ⋆ k be the set of vertices of G ⋆ k , i.e. the subset of types which are in the terminal strongly connected component.Furthermore, we write Another easy-to-establish property is the following lemma, regarding aperiodicity.It will be useful when applying the Drmota-Lalley-Woods theorem in Section 3.3.
Lemma 5 All series C t for t in T ⋆ k are aperiodic.
Proof: A standard EF game argument -see (Albert et al., 2020, Propositions 24 and 26) -asserts that there exists K > 0 such that all permutations 12 • • • n for n ≥ K have the same logical type of order k, which we will denote by t ↗ .Clearly, C t ↗ is aperiodic.
Furthermore, it is easy to see that aperiodicity propagates along edges of the dependency graph.More formally, we claim that if C u is aperiodic for some type u, and if ∂Ft ∂Cu ̸ = 0, then C t is aperiodic.Indeed, in this case, F t contains a monomial zC u C v for some v. Since C v ̸ = 0, there exists r such that C t ≥ z r C u coefficient-wise, implying that C t is aperiodic.
Starting from C t ↗ , we can follow outgoing edges of the dependency graph until we reach a state t 0 in the terminal strongly connected component.Then C t0 is aperiodic.Using again the propagation of aperiodicity along edges, we conclude all series C t , for t ∈ T ⋆ k are aperiodic.2 3.2 The Jacobian matrix and its spectral radius.
We consider the Jacobian matrix of the system: Its rows and columns are indexed by elements of T k .To write down the matrix, we order T k such that the elements of T ⋆ k come first.Let t and u be in T • k and T ⋆ k respectively.Since u is in the terminal component of G k , while t is not, there cannot be an edge from u to t.Hence, by construction, one has ∂Ft ∂Cu = 0.This implies that the matrix M k then decomposes into blocks as where M ⋆ k and M • k are the Jacobian matrices restricted to T ⋆ k and T • k respectively, 0 is the zero matrix, and * denotes an unknown matrix.
For a square matrix A we denote SR(A) its spectral radius, i.e. the maximum modulus of an eigenvalue of A. The following lemma will be useful in Section 3.3 for finding the radii of convergence of the series that are solutions of our system (4).
The same argument, together with the fact that the lower left block of M k is filled with zeroes, proves that SR(M ⋆ k (1/4)) = 1.We now consider M • k (1/4), which appears as a block in M k (1/4) (see decomposition ( 5)).Fix an arbi- By construction, we have M k (1/4) tu,u > 0. This implies that the column indexed by u in M k (1/4) has a nonzero element outside the block M • k (1/4).Consequently, the column sums of M • k (1/4) are smaller than those of M k (1/4), i.e., for u in T • k , we have Using that the spectral radius is at most the maximal column sum, we get SR(M • k (1/4)) < 1. 2 3.3 Radius of convergence and asymptotic analysis.
Lemma 7 For t in T • k , C t has radius of convergence strictly larger than 1/4.Consequently, there exists Proof: Let t be in T • k and consider the equation C t (z) =: F t (z; C u , u ∈ T k ) in the system (4).As explained above (see the text above Eq.( 5)), this equation only involves series C u , for u in T • k (and not those for u in T ⋆ k ).We can therefore consider the restriction of the system (4) to the variables (C t , t ∈ T • k ): The Jacobian matrix of this system at z = 1/4 is M • k (1/4).From Lemma 6, the matrix (Id −M • k (1/4)) is invertible.Therefore, using the multivariate implicit function theorem -see (Woods, 1997, Lemma 5.1) or (Flajolet and Sedgewick, 2009, Theorem B.6) -, Eq. ( 6) has a unique solution for z in a neighbourhood V of 1/4, and this solution defines analytic functions C t for t in T • k .We recall that C t (z) is analytic for |z| < 1/4 for all t in T k , since C t is dominated coefficient-wise by the Catalan series C(z).The above result means that for t in T • k , there is an analytic extension of C t in a neighbourhood of 1/4, i.e. 1/4 is not a singularity of C t .Since C t has nonnegative coefficients, Pringsheim's theorem applies (Flajolet and Sedgewick, 2009, Theorem IV.5), and we conclude that C t has a radius of convergence larger than 1/4 (for t in T • k ).The consequence on the growth of the coefficients [z n ]C t (z) is standard; see, e.g., (Flajolet and Sedgewick, 2009, Theorem IV.7). 2 Lemma 8 For t in T ⋆ k , there exists a constant A t > 0 such that, as n tends to +∞, one has Proof: We consider the system (4) as a system of equations for the series (C u ; u ∈ T ⋆ k ), seeing the series The dependency graph of this system is strongly connected, and we will apply the Drmota-Lalley-Woods theorem (v) recalled in Section 2.4.Conditions 1, 2, 3 and 4 of Proposition 3 are easy to check.Condition 6 follows from Lemma 5.It remains to check condition 5. (v) We note that, even though the original system (4) is polynomial, the restricted system (8) after substitution of the (Cu) u∈T • k , is not polynomial any more since some of the Cu might be infinite series.This is the reason why we need the general version of Drmota-Lalley-Woods theorem with analytic equations, and not only the one for polynomial systems presented in Flajolet and Sedgewick (2009).
The functions Φ t are power series with nonnegative integer coefficients and are analytic on the region , where ρ 2 is the minimal radius of convergence of a series C v (z) with v ∈ T • k (recall that Φ t now depends on z through the substituted series C v (z) with v ∈ T • k ).From Lemma 7, we have ρ 2 > 1/4.We recall that all series (C u ) u∈T ⋆ k are convergent at z = 1/4 (since they are coefficient-wise dominated by C).The point (1/4, (C u (1/4)) u∈T ⋆ k ) therefore lies in the analyticity region of the functions Φ t .We claim that Besides, the equality is implied by Lemma 6 (the Jacobian matrix of the restricted system is M ⋆ k ).We conclude that condition 5 of Proposition 3 is satisfied as well.

Concluding the proof of the logical limit law
Let Ψ be a first-order sentence on permutations, and denote by k its quantifier depth.Then there exists a subset This implies, for n ≥ 1 and σ n a uniform random 231-avoiding permutation of size n, Since the set T k of k-logical types of permutations is finite, the above sum is finite.The existence of a limit then follows from Lemmas 7 and 8, recalling that [z n ]C(z) ∼ π −1/2 4 n n −3/2 .This proves the logical limit law.
Item 1 in Theorem 1 also follows immediately.If T Ψ contains at least one type in T ⋆ k , then the limit of P(σ n |= Ψ) is positive.On the other hand, if T Ψ ∩ T ⋆ k = ∅, then P(σ n |= Ψ) decreases exponentially fast to 0 by Lemma 7.

Set of limiting probabilities
We consider here the set of limiting probabilities L := lim n→+∞ P(σ n |= Ψ), Ψ FO sentence , and we want to prove that it is dense in [0, 1], which is the remaining part of Theorem 1.
We start by recalling a result of Kakeya on the set of subsums of a convergent series, see Kakeya (1915) for the original statement and Nymann and Sáenz (2000) for a complete proof.We only copy here a part of the theorem, which is the one relevant for us.
Lemma 9 Let (p i ) i≥0 be a non-increasing sequence of positive real numbers such that i≥0 p i < +∞.
Assume that for all i ≥ 0, one has p i ≤ j>i p j .Then i.e. the set of (finite and infinite) subsums of i≥0 p i is the whole interval 0, i≥0 p i .
In the following, we use the notation Cat n = 1 n+1 2n n for the n-th Catalan number.Let σ n be a uniform random 231-avoiding permutation of size n.We can decompose σ n as σ n = τ n ⊕ (1 ⊖ π n ).Note that τ n and π n are random 231-avoiding permutations, and that their sizes themselves are random.Their asymptotic distribution is given as follows.
Lemma 10 Fix a 231-avoiding permutation ρ.Then we have Let F and F ′ be two finite subsets of Av(231).We consider the event E F ,F ′ : (τ n ∈ F) ∨ (π n ∈ F ′ ).
Clearly, E F ,F ′ is a first order property.For n large enough, the events τ n ∈ F and π n ∈ F ′ are incompatible since |τ n | + |π n | = n − 1.We therefore have, using Lemma 10 where F k (resp.F ′ k ) is the set of permutations of size k in F (resp.F ′ ), and where K is the maximal size of a permutation in either F or F ′ .For each k ≤ K, the quantity |F k | + |F ′ k | can take any value between 0 and 2 Cat k , so that L contains the set Let (p i ) i≥0 be the non-increasing sequence containing 4 −k−1 exactly 2 Cat k times for each k ≥ 0, and no other elements.We have where we recall that C(z) = (1− √ 1 − 4z)/(2z) is the Catalan generating series.On the other hand, In words, L ′ is the set of finite subsums of i≥0 p i .Its topological closure contains the set L ′′ of all (finite or infinite) subsums of i≥0 p i .Observe finally that p i ≤ j>i p j for all i.Applying Lemma 9, we have L ′′ = [0, 1], concluding the proof of Theorem 1.

Fig. 1 :
Fig. 1: A permutation in matrix form with associated linear orders A <P B <P C <P D <P E, and B <V E <V A <V C <V D.