INTERMEDIATE DIMENSIONS OF BEDFORD–MCMULLEN CARPETS WITH APPLICATIONS TO LIPSCHITZ EQUIVALENCE

. Intermediate dimensions were introduced to provide a spectrum of dimensions interpolating between Hausdorff and box-counting dimensions for fractals where these differ. In particular, the self-affine Bedford–McMullen carpets are a natural case for investigation, but until now only very rough bounds for their intermediate dimensions have been found. In this paper, we determine a precise formula for the intermediate dimensions dim θ Λ of any Bedford– McMullen carpet Λ for the whole spectrum of θ ∈ [0 , 1] , in terms of a certain large deviations rate function. The intermediate dimensions exist and are strictly increasing in θ , and the function θ (cid:55)→ dim θ Λ exhibits interesting features not witnessed on any previous example, such as having countably many phase transitions, between which it is analytic and strictly concave. We make an unexpected connection to multifractal analysis by showing that two carpets with non-uniform vertical fibres have equal intermediate dimensions if and only if the Hausdorff multifractal spectra of the uniform Bernoulli measures on the two carpets are equal. Since intermediate dimensions are bi-Lipschitz invariant, this shows that the equality of these multifractal spectra is a necessary condition for two such carpets to be Lipschitz equivalent.


Introduction
In dimension theory, the two most studied notions of dimension are the Hausdorff and box (also called Minkowski) dimension.For a specific set, a central question is whether its Hausdorff and box dimension are distinct or not.Intuitively, a dimension gap occurs when the set is inhomogeneous in space, and thus cannot be covered optimally by using sets of equal diameter.An important class of dynamically defined sets exhibiting this phenomena are self-affine carpetlike constructions in the plane and sponges in higher dimensions.There are many other sets in R d whose Hausdorff and box dimensions differ: for example infinitely generated self-conformal sets, elliptical polynomial spirals, images of sets under certain stochastic processes [12,17], or even the connected component of supercritical fractal percolation [11].
A line of research has been initiated by Falconer, Fraser and Kempton [23] in order to get a better understanding of the subtle differences between the Hausdorff and box dimensions.The idea is that by introducing a continuum of intermediate dimensions which interpolate between these two notions of dimension, one can obtain more nuanced information about the geometry of the set.This is done by imposing increasing restrictions on the relative sizes of covering sets governed by a parameter 0 ≤ θ ≤ 1.The Hausdorff and box dimension are the two extreme cases when θ = 0 and 1, respectively.All sets we consider will be bounded and non-empty subsets of Euclidean space.The diameter of a set F is denoted by |F |, its Hausdorff dimension by dim H F and its lower and upper box dimensions by dim B F and dim B F .A finite or countable collection of sets {U i } is a cover of F if F ⊆ i U i .Definition 1.1.For 0 ≤ θ ≤ 1, the lower θ-intermediate dimension of a set F ⊂ R d is given by dim θ F = inf{s ≥ 0 : for all ε > 0 and all δ 0 > 0, there exists 0 < δ ≤ δ 0 and a cover {U i } of F such that δ 1/θ ≤ |U i | ≤ δ and |U i | s ≤ ε}, while its upper θ-intermediate dimension is dim θ F = inf{s ≥ 0 : for all ε > 0 there exists δ 0 > 0 such that for all 0 < δ ≤ δ 0 , there is a cover {U i } of F such that δ 1/θ ≤ |U i | ≤ δ and |U i | s ≤ ε}.
For a given θ, if the values of dim θ F and dim θ F coincide, then the common value is called the θ-intermediate dimension and is denoted by dim θ F .We refer to the quantity |U i | s as the s-cost of the cover.
With these definitions, dim 0 F = dim 0 F = dim H F , dim 1 F = dim B F and dim 1 F = dim B F , see [20,Chapter 2,Section 3.2].For the Hausdorff dimension there are no restrictions on the diameters of the covering sets, for the box dimension the diameters of the covering sets must be the same, while for dim θ F the restriction is to only consider covering sets with diameter in the range [δ 1/θ , δ].As θ → 0, the θ-intermediate dimension gives more insight into which scales are used in the optimal cover to reach the Hausdorff dimension.For θ < 1, a natural covering strategy to improve on the exponent given by the box dimension is to use covering sets with diameter of the two permissible extremes, in other words either δ 1/θ or δ.Intuitively, it is more cost efficient in terms of s-cost to cover F with sets of diameter δ 1/θ where F is "sparse" in some appropriate sense and use the larger sets of diameter δ where F is "dense".
Most previous examples whose θ-intermediate dimensions are known explicitly [14,22,23,48] share the common feature that the function θ → dim θ F for the range of θ where dim θ F > dim H F is strictly increasing, concave and analytic, in particular there are no phase transitions.Interestingly, except in [3] and [5], the heuristic of using the two extreme scales already leads to the optimal covering strategy.The standard approach to see whether a covering strategy gives the optimal exponent is to check whether a mass distribution principle [23,Proposition 2.2] applied to a measure constructed from this particular cover gives the matching lower bound.
For a set F , the functions θ → dim θ F and θ → dim θ F are non-decreasing, and are continuous for θ ∈ (0, 1] but not necessarily at θ = 0. Banaji and Rutar [5] proved a necessary and sufficient condition for a given function h(θ) to be realised as the intermediate dimensions of a set.This condition involves a straightforward constraint on the Dini derivatives of h(θ), and demonstrates that the intermediate dimensions of sets can have highly varied behaviour.Banaji [1] introduced a more general family of dimensions, called the Φ-intermediate dimensions, which can provide more refined geometric information about sets whose intermediate dimensions are discontinuous at θ = 0.If the intermediate dimensions of a set are in fact continuous at θ = 0, then this has consequences for its orthogonal projections, see [13,Section 6], and its images under index-α fractional Brownian motion, see [12,Section 3].
Intermediate dimensions can also be formulated using capacity theoretic methods [13].This approach has been used to bound the Hölder regularity of maps that can deform one spiral into another [14], compute the almost-sure value of the intermediate dimension of the image of Borel sets under index-α fractional Brownian motion in terms of dimension profiles [12] and under more general Rosenblatt processes [17].
Qualitative information about dim θ F can also yield interesting applications.For example, the intermediate dimensions can be used to give information about the Hölder distortion of maps between sets (see [26,Section 17.10] for discussion of the Hölder mapping problem in the context of dimension theory).In [21, Section 14.2.1 5.] Falconer noted that if F ⊂ R d and f : F → R d is an α-Hölder map for some α ∈ (0, 1], meaning that there exists c > 0 such that ∥f (x) − f (y)∥ ≤ c∥x − y∥ α for all x, y ∈ F , then and dim θ f (F ) ≤ α −1 dim θ F (see [12,Theorem 3.1] and [1,Section 4] for further Hölder distortion estimates).In [3,Example 4.5], Banaji and Fraser showed that the intermediate dimensions can give better information about the Hölder distortion between some continued fraction sets than the Hausdorff or box dimensions.We mention a similar concept of dimension interpolation between the upper box dimension and the (quasi-)Assouad dimension, called the Assouad spectrum, which was initiated in [29,30].We refer the reader to the surveys [21,27] for additional references on the topic of dimension interpolation.
An important method for generating fractal sets is via iterated function systems (IFSs); see [20] for general background.In this paper, we consider self-affine sets, which are the attractors of IFSs consisting of affine contractions.We refer the reader to [19] for a survey of the dimension theory of self-affine sets, and to [7] for an important result.Self-affine carpets are widely-studied families of sets in the plane which often have distinct Hausdorff and box dimensions.As such, it is natural to consider their intermediate dimensions.The main objective of this paper is to determine an explicit formula for the intermediate dimensions of the simplest model, originally introduced independently by Bedford [10] and McMullen [40].Moreover, in the process we uncover new interesting features about the form of the intermediate dimensions and make an unexpected connection to multifractal analysis and bi-Lipschitz equivalence of these carpets.for the index set (i, j) ∈ A ⊆ {1, . . ., m} × {1, . . ., n}.It is well-known that associated to the iterated function system (IFS) F = {f (i,j) } (i,j)∈A there exists a unique non-empty compact set Λ = Λ F , called the attractor, satisfying Λ = (i,j)∈A f (i,j) (Λ).
We call Λ a Bedford-McMullen carpet.The carpet Λ can also be viewed as an invariant subset of the 2-torus [0, 1) 2 under the toral endomorphism (x, y) → (mx mod 1, ny mod 1).We refer the interested reader to the survey [28] for further references.The left hand side of Figure 1  For the remainder of the paper, we index the maps of F by i ∈ {1, . . ., N }.Let 1 < M ≤ m denote the number of non-empty columns and N := (N 1 , . . ., N M ), where N ȷ is the number of maps f i that map [0, 1] 2 to the ȷ-th non-empty column.Observe that N = N 1 + • • • + N M .Let P M denote the set of probability vectors on {1, . . ., M }.The entropy of q ∈ P M is where we use the convention that 0 log 0 = 0. We introduce P = (P 1 , . . ., P M ) := N 1 N , . . ., N M N and Q := 1 M , . . ., 1 M .
For q ∈ P M , it holds that H(q) ≤ log M with equality if and only if q = Q.For the entire paper, we also introduce log N ȷ and t := log N − H(P). (1.2) We say that Λ has uniform (vertical) fibres if and only if P = Q, in other words each non-empty column has the same number of maps.Bedford and McMullen showed that the Hausdorff and box dimensions of Λ are equal to ) In particular, dim H Λ = dim B Λ if and only if Λ has uniform fibres.In this case, θ → dim θ Λ is just a constant function.Therefore, we assume throughout that the carpet has non-uniform fibres, in which case the appropriate dimensional Hausdorff measure of Λ is infinite [44].Using the concavity of the logarithm function, an immediate consequence of non-uniform fibres is that t < log(N/M ).
Previous results.Previous papers on the topic [23,27,35] have established crude bounds for the intermediate dimensions and speculated about the possible form.The question of determining the intermediate dimensions of all Bedford-McMullen carpets was explicitly asked in [21,23,27,28,35].Loosely speaking, the results of Falconer, Fraser and Kempton [23] concentrate on the behaviour of dim θ Λ for θ close to 0, while the results of Kolossváry [35] concentrate on the behaviour for θ ≥ γ −1 .More precisely, a linear lower bound was obtained in [23] which shows that dim θ Λ > dim H Λ for every θ ∈ (0, 1].This bound can be used to show that θ → dim θ Λ cannot be convex in general.Moreover, the authors give a general lower bound which reaches dim B Λ at θ = 1.This general lower bound was improved in [1,Proposition 3.10].For many, but not all carpets, a lower bound in [35] performs better than these general bounds and the linear bound for larger values of θ.The lower bound depicted in Figure 1 in orange is the best combination of these results. Falconer, Fraser and Kempton [23,Proposition 4.1] show an upper bound of the form dim θ Λ ≤ dim H Λ + c/(− log θ) for an explicit c > 0 and θ sufficiently small.In particular, this implies that θ → dim θ Λ and θ → dim θ Λ are continuous also at θ = 0. Hence, the results of Burrell, Falconer and Fraser [13,Section 6] and Burrell [12,Section 3] can be applied.For example, if dim H Λ < 1 ≤ dim B Λ then dim B π(Λ) < 1 for every orthogonal projection π from R 2 onto a 1-dimensional subspace.For almost every projection, dim θ π(Λ) and dim θ π(Λ) are continuous at θ = 0, and if γ / ∈ Q then this holds for every orthogonal projection.Furthermore, if A cover of Λ is constructed in [35] using just the two extreme scales to obtain an explicit upper bound of the form dim θ Λ ≤ dim B Λ − ∆(θ) for θ ≥ γ −1 , where ∆(θ) ↘ 0 as θ → 1 and has a strictly positive derivative at θ = 1.This bound was used to show that dim θ Λ is not concave for the whole range of θ in general, already hinting at richer behaviour than previously witnessed in other examples.Figure 1 shows this upper bound in green.
1.2.Summary of results.The formal statements are presented in Section 2. In Theorem 2.1 we state an explicit formula for dim θ Λ = dim θ Λ for all θ ∈ (0, 1], thus completely resolving the problem of calculating the intermediate dimensions of any Bedford-McMullen carpet Λ.For illustration see the right hand side of Figure 1, where θ → dim θ Λ is plotted in blue for the carpet on the left hand side of Figure 1.Central to the formula is a large deviations rate function for which we give three additional equivalent characterisations in Proposition 2.11: one in terms of a pressure-like function, another as a certain probability vector with an entropy maximising property, and finally a relationship to the multifractal spectrum of the uniform self-affine measure on Λ.In the proof of Theorem 2.1, we construct a cover of Λ that uses an increasing number of different scales in the permissible range as θ → 0. We also show in Corollary 2.2 that using more than two scales is necessary. We prove all the features suggested by the plot in Figure 1 about the form of the intermediate dimensions for all carpets in Corollary 2.3.Namely, θ → dim θ Λ is strictly increasing and has phase transitions at all negative integer powers of γ. Between consecutive phase transitions the intermediate dimensions are analytic and strictly concave.Moreover, for θ small enough dim θ Λ behaves like dim H Λ + c(log θ) −2 .In particular, the derivative tends to +∞ as θ → 0. No previous family of sets has shown such rich and complex behaviour.Some illustrative examples are presented in Section 2.5.
We show in Theorem 2.5 that two different carpets with non-uniform vertical fibres have equal intermediate dimensions for every θ ∈ [0, 1] if and only if the multifractal spectra of the uniform Bernoulli measure on the two carpets are equal.If, in addition, it is assumed that the two carpets are defined on the same grid, then Theorem 2.5 provides further equivalent conditions for their intermediate dimensions to be the same: a certain condition on the rate functions appearing in the formula or certain relationships between the parameters of the carpets, or the equality of the intermediate dimensions on any one open interval of [γ −1 , 1].
Our main application relates to bi-Lipschitz equivalence.It is known [46, Corollary 1.1] that the equality of these multifractal spectra is necessary for two carpets to be bi-Lipschitz equivalent if it is assumed that the two carpets are defined on the same grid and are totally disconnected.Since bi-Lipschitz maps preserve intermediate dimensions, Theorem 2.5 implies that both of these assumptions can be dropped, see Corollary 2.10.In Example 2.14 we construct two carpets which are not bi-Lipschitz equivalent by Corollary 2.10, but where this does not follow from [46].To our knowledge, this is the first instance where intermediate dimensions are used to show that two sets are not bi-Lipschitz equivalent, but where this fact does not follow from any other notion of dimension or existing result.For this example, we also use the intermediate dimensions to give estimates on the Hölder distortion.
For comparison, we mention that the calculation of the Assouad spectrum of Bedford-McMullen carpets [29] is not as involved as the proof of Theorem 2.1 for the intermediate dimensions.Indeed, the intermediate dimensions are more subtle in that they depend on all the N i individually, as does the Hausdorff dimension.This is in contrast to the Assouad spectrum (and indeed the lower spectrum and the box, packing, Assouad, quasi-Assouad, lower and quasi-lower dimensions) which depend only on m, n, N, M, max 1≤î≤M N î and min 1≤î≤M N î, see [28].The Assouad spectrum also has just one phase transition at θ = γ −1 , which occurs when the spectrum reaches the Assouad dimension and thus is constant for θ ∈ (γ −1 , 1).

Complete statements and examples
2.1.Main result: formula for intermediate dimensions.Recalling (1.2), let t ∈ (t, t).This is a non-empty interval because non-uniform fibres implies that t < log(N/M ) < t.Let X 1 , X 2 , . . ., X J , . . .be a sequence of independent and identically distributed random variables taking values in the set {log N 1 , . . ., log N M }, with Then t is the expectation of X 1 .The large deviations rate function of the average 1 J J i=1 X i is noting that 1 M M ȷ=1 N λ ȷ is the expectation of e λX 1 .For t ∈ [t, max 1≤î≤M log N î), differentiating shows that the supremum in the definition of I(t) is attained at the unique λ ≥ 0 satisfying This allows I(t) to be calculated numerically.On this interval, I(t) is real analytic (as the Legendre transform of an analytic function).The derivative I ′ (t) > 0 is the value of λ at which the supremum is attained and I(t) is strictly increasing for t ∈ [t, max log N î].Moreover, I ′′ (t) > 0, so the function is strictly convex on this interval.Some particular values of interest are For s ∈ R, we define the function T s : R → R by For ℓ ∈ N we denote the composition by , and T 0 s denotes the identity function.
We use the sequences Note that these depend only on s and the carpet, but not on θ.Observe that T s (t) = t 1 (s) for all s ∈ R. We are now ready to state the main result of this paper; see Section 5 for the rather involved proof.
In the case L = 1 the formula (2.5) simplifies to Theorem 2.1 and Corollary 2.3 below fully resolve [28,Problem 15.8.1] and the questions about Bedford-McMullen carpets in Falconer's survey paper [21,Section 14.8], and indeed provide more information.In particular, this is the first time it has been shown that the intermediate dimensions of Bedford-McMullen carpets exist for θ ∈ (0, 1).Tools used in the proof include the method of types (see [36]) and a variant of a mass distribution principle for the intermediate dimensions, see Proposition 4.1.The proof of the upper bound involves the construction of an explicit cover using scales δ, δ γ , δ γ 2 , . . ., δ γ L−1 and δ 1/θ , δ 1/(γθ) , . . ., δ 1/(γ L−1 θ) .This cover consists of approximate squares, which we define in Section 4.2.We decide which parts of each approximate square to cover at which scale depending on how the different parts of the symbolic representation of the approximate square relate to each other.The proof simplifies when θ ≥ 1/γ (where we just use the smallest and largest permissible scales), and when θ = γ −k for k ∈ N (where we use scales δ, δ γ , . . ., δ γ k due to scales 'lining up').Note that the cover jumps from using 2k scales when θ ∈ (γ −k , γ −(k−1) ) to using 2k + 2 scales when θ ∈ (γ −(k+1) , γ −k ) (and uses only k scales when θ = δ −k ), which gives an indication of why one might expect a phase transition at θ = γ −k .
In [21,Section 14.8], Falconer asked about the number of different scales of covering sets needed to approximate the intermediate dimensions of sets arbitrarily closely from above.Corollary 2.2, which we prove in Section 6.1, shows that for Bedford-McMullen carpets with non-uniform fibres, more than two scales are needed when θ is small.It has been shown that there exist sets where an unbounded number of scales is required as δ → 0 + , see [5,Remark 3.11].
A possible direction for further research could be to investigate the intermediate dimensions of higher dimensional Bedford-McMullen sponges, or the self-affine carpets in the plane of Lalley and Gatzouras [37] or Barański [6].However, we expect this to be challenging, not least because it is not clear what would take the place of the important quantity γ.In light of the recent paper [4] proving that the Assouad spectrum of Gatzouras-Lalley carpets (unlike Bedford-McMullen carpets) can be a differentiable function of θ, it is natural to ask whether the intermediate dimensions of Gatzouras-Lalley carpets can also be differentiable on (0, 1).
We now continue with corollaries of Theorem 2.1 about the form of the graph of the function θ → dim θ Λ that do not follow from the general theory, give a rather unexpected connection to multifractal analysis and bi-Lipschitz equivalence of two carpets, and give equivalent formulations of the rate function I(t).

Form of the intermediate dimensions.
We assume that the carpet has non-uniform fibres, otherwise, θ → dim θ Λ is just a constant function.We denote the left and right derivatives at θ by Corollary 2.3.Let Λ be a Bedford-McMullen carpet with non-uniform vertical fibres.Then the function θ → dim θ Λ has the following properties: (i) it is real analytic on the interval (γ −L , γ −(L−1) ) for all L ∈ N; (ii) ∂ − dim θ Λ exists at every θ ∈ (0, 1] and ∂ + dim θ Λ exists at every θ ∈ (0, 1); (iii) it is strictly increasing and has phase transitions at every negative integer power of γ.More precisely, there exists C 0 > 0 depending only on Λ such that for all θ ∈ (0, 1), with equality if and only if for all L ∈ N we have θ ̸ = γ −L .Moreover, (v) it is strictly concave on the interval [γ −L , γ −(L−1) ] for all L ∈ N.
In [23,Proposition 4.1] for small enough θ the upper bound dim θ Λ ≤ dim H Λ + c(− log θ) −1 was proved for a constant c depending only on Λ. Corollary 2.3 (iv) shows that although this bound is not sharp, we do indeed have that

2.3.
Connection to multifractal analysis and bi-Lipschitz equivalence.In this section, and in Section 6.3 where we prove the results in this section, it is convenient to change notation.Here, the parameters (M 0 , N 1 , . . ., N M 0 , R 1 , . . ., R M 0 ) will define a Bedford-McMullen carpet.Now M 0 denotes the number of different values that the number of maps in a non-empty column can take.Note that M 0 ≥ 2, since M 0 = 1 corresponds to the uniform fibre case.We write N 1 , . . ., N M 0 for the actual values that the number of maps in a non-empty column can take, and we order them as For each î ∈ {1, . . ., M 0 }, we write R î for the number of columns containing exactly N î maps.As with the previous notation, we write M = M 0 î=1 R î for the number of non-empty columns, and N = M 0 î=1 R îN î for the total number of maps.For example, for the carpet in Figure 1, the number of maps in a non-empty column is either 1 or 2, so N 1 = 2 and N 2 = 1; each corresponds to just one column, so R 1 = R 2 = 1, and A central problem in multifractal analysis is to examine the way a Borel measure µ is spread over its support supp µ.For a survey of this topic, we refer the reader to [20,Chapter 17].The local dimension of µ at x is if the limit exists, which approximately measures the rate of decay of µ(B(x, r)) as a power law r α .The measure µ is exact dimensional if dim loc (µ, x) is equal to a specific α for µ-almost all x.However, dim loc (µ, x) can still potentially take up a whole spectrum of different α.This motivates the definition of the fine or Hausdorff multifractal spectra Concentrating on the self-affine setting, given a self-affine iterated function system S = {S 1 , . . ., S N }, meaning that all S i : R d → R d are contracting affine maps, and a probability vector p with strictly positive entries, the self-affine measure µ p is the unique probability measure supported on the attractor of S satisfying It is known that all self-affine measures are exact dimensional [8,24] and the dimension satisfies a Ledrappier-Young type formula; this was resolved earlier in [33] for those supported on Bedford-McMullen carpets.The fine multifractal spectrum of self-affine measures on Bedford-McMullen carpets is also known [9,32,34] and (under the separation condition assumed in [34]) has been generalised to higher dimensions in [43].When p = (1/N, . . ., 1/N ) is the uniform vector, we simply write ν = µ p and call it the uniform self-affine measure.In this case, define the function Note that because of the minus sign before β ν (ξ) (which in some papers is erroneously omitted), β ν (ξ) is a convex function.Define Then by [32, Theorem 1], the multifractal spectrum is where is the Legendre transform of β ν (defined in the same way as for the rate function in (2.2)).
Another quantity that is closely related to the multifractal spectrum is the L q spectrum of a measure µ.It is a function T µ : R → R which quantifies the global fluctuation of µ, and its value at q = 0 describes the box dimension of the support of the measure.The L q spectrum can be defined by − log δ (2.8) (the limit exists for all measures we consider), where T δ (µ, q) := sup i (µ(B i )) q : B i disjoint balls of radius δ centred in supp(µ) .
Let ν be the uniform self-affine measure on a Bedford-McMullen carpet with non-uniform fibres, and let ν x be the measure obtained by projecting ν orthogonally onto the x-axis.Note that ν x is a self-similar measure with all contraction ratios equal to 1/m, satisfying the open set condition; the L q spectrum of such measures has been studied in [15] and [20,Chapter 17].For q in an open neighbourhood of 1, T νx (q) satisfies A direct calculation shows that Measures such as ν x satisfy the multifractal formalism, meaning that the Legendre transform of its L q spectrum equals its multifractal spectrum, but this is not generally satisfied by ν.Instead, a result of Feng and Wang [25, Theorem 2] shows that T ν (q) satisfies N • N −q m −Tν x (q) n −(Tν (q)−Tν x (q)) = 1, and a direct manipulation shows that for q in an open neighbourhood of 1, (2.9) Before describing the connection between the multifractal spectra and the intermediate dimensions, we observe that the grid on which a carpet can be defined is not unique, and in fact by iterating the IFS one can see that every carpet can be defined on infinitely many grids.For example, by iterating the IFS, the carpet from Figure 1 can be defined on a 2 × 3 grid or on a 4 × 9 grid (though of course many carpets on a 4 × 9 grid cannot be realised on a 2 × 3 grid).Theorem 2.4 gives information about the grids on which a carpet can be defined, and is proved in Section 6.3.It demonstrates for example that since 2 and 3 are multiplicatively independent, a carpet with non-uniform fibres defined on a 2 × 4 grid cannot be defined on a 3 × 9 grid (even though log 4/ log 2 = log 9/ log 3).Theorem 2.4.
(1) If a Bedford-McMullen carpet Λ with non-uniform fibres can be defined on both a m × n grid and on a m ′ × n ′ grid, then log n/ log m = log n ′ / log m ′ and log n/ log n ′ ∈ Q.
(2) Consider two carpets Λ 1 and Λ 2 with non-uniform fibres which are defined by IFSs S 1 and S 2 on grids of size m 1 × n 1 and m 2 × n 2 respectively.Then they can be realised on the same grid if and only if In fact, we will see below that if two carpets with non-uniform fibres are bi-Lipschitz equivalent then they can be defined on the same grid.The same is true even if we merely assume the carpets have the same intermediate dimensions, or support uniform Bernoulli measures with equal multifractal spectra.
We make some remarks about part (2).The reverse implication is immediate.Indeed, if log n 1 / log n 2 = log m 1 / log m 2 = a/b ∈ Q, then the b-th iterate of S 1 and the a-th iterate of S 2 are both defined on the same grid of size m b 1 × n b 1 .It is straightforward to see that the rate function I(t) of S 1 and the rate function I (b) (t) of the b-th iterate of S 1 are related by I (b) (bt) = bI(t).For the forward implication, if both carpets can be realised on the same grid, then the fact that log n 1 / log m 1 = log n 2 / log m 2 was noted by Fraser and Yu using the Assouad spectrum in [29,Theorem 3.3], and also follows from the intermediate dimension formula, noting that geometric quantities such as dimensions of course do not change by taking an iterate of the system.The fact that n and n ′ must be multiplicatively dependent follows from Lemma 6.3, and is related to work of Meiri and Peres [41,Theorem 1.2].This is in turn related to Furstenberg's ×2, ×3 principle (which suggests that expansions in multiplicatively independent bases should have no common structure).
Our next result, which we prove in Section 6.3 using Theorem 2.1, gives a direct connection between the intermediate dimensions and the multifractal and L q spectra of the uniform selfaffine measure.
Theorem 2.5.Let Λ and Λ ′ be two Bedford-McMullen carpets with non-uniform fibres, and denote the corresponding uniform self-affine measures by ν and ν ′ .Then the following are equivalent: (1) 2) hold, then both carpets can be defined on the same grid.Now assume that Λ and Λ ′ are defined on the same m × n grid to begin with, with parameters }, respectively.Denote the corresponding rate functions defined in (2.2) by I(t) and I ′ (t).Let t and t be as defined previously, for the carpet Λ.Let (a, b) ⊂ (γ −1 , 1) be a (non-empty) open interval.Then each of (1), ( 2) is equivalent to each of the following: ) γ for all î = 1, . . ., M 0 .We make several comments about Theorem 2.5.
Remark 2.6.(i) For carpets defined on the same grid, the equivalence of (2) and the explicit condition (6) was proved by Rao, Yang and Zhang in [46, Theorem 1.2], using [32].(ii) In Step 4 of the proof of Proposition 2.11 in Section 3, we use scaling properties of Legendre transforms to establish a direct link between the multifractal spectrum of the uniform Bernoulli measure and the rate function I(t).Since I(t) appears in the intermediate dimension formula, this indicates why the link between the intermediate dimensions and multifractal spectrum in Theorem 2.5 is to be expected.(iii) For carpets defined on the same grid with M = M ′ , (6) is simply saying that the column sequence of one carpet is a permutation of the column sequence of the other.(iv) Equality of the L q dimensions and the coarse multifractal spectra can be added to the above equivalences in Theorem 2.5 if the carpets are defined on the same grid, since these quantities can be obtained from the L q spectrum by dividing by 1 − q or taking the Legendre transform respectively.(v) If (4) holds then other notions of dimension of ν and ν ′ which can be deduced from their L q spectra must be equal, such as exact (Hausdorff/packing/entropy) dimension, correlation dimension (Rényi entropy), and Frostman dimension.(vi) The formulae in [28] and (6) can be used to show that equality of intermediate dimensions implies equality of other notions of dimensions of sets such as packing, Assouad, quasi-Assouad, lower, quasi-lower or modified lower dimensions, or the Assouad spectrum or lower spectrum for any fixed θ ∈ (0, 1).
Since the multifractal spectrum is analytic (as the Legendre transform of an analytic function), if I ⊆ (α min , α max ) is an open interval, then (2) holds for all α ∈ I if and only if it holds for all α ∈ (α min , α max ).Similarly, if J ⊆ (t, t) is an open interval then (5) holds for all t ∈ J if and only if it holds for all t ∈ (t, t).Question 2.7.In the statement of Theorem 2.5, can (a, b) be taken to be an arbitrary open subinterval of (0, 1)?
Since the proof strategy of Lemma 6.3 does not seem to work under the assumption that the L q spectra are equal, we ask the following question.
Question 2.8.Do there exist two Bedford-McMullen carpets with non-uniform fibres which cannot be realised on the same grid but whose uniform Bernoulli measures have the same L q spectra?Turning now to bi-Lipschitz equivalence, recall that two metric spaces (X, d X ) and (Y, d Y ) are bi-Lipschitz equivalent if there is a bi-Lipschitz map f : X → Y , i.e. one for which there exists Partial progress towards Question 2.9 has been made in [38,46,49], all of which assume some disconnectivity property.Fraser and Yu [29] used the Assouad spectrum to show that γ is a bi-Lipschitz invariant within the class of Bedford-McMullen carpets, a fact which is also evident from observing the form of the intermediate dimensions.Moreover, the gap sequence of a set is a topological quantity which has been shown to be bi-Lipschitz invariant [45], and which is known for Bedford-McMullen carpets [39,42].Using the fact that the intermediate dimensions are stable under bi-Lipschitz maps, we obtain the following necessary condition for bi-Lipschitz equivalence as an immediate corollary of Theorem 2.5.
Corollary 2.10.Let Λ and Λ ′ be two Bedford-McMullen carpets with non-uniform fibres which are bi-Lipschitz equivalent, and let ν and ν ′ be the corresponding uniform Bernoulli measures.Then f ν (α) = f ν ′ (α) for all α ∈ (α min , α max ) and T ν (q) = T ν ′ (q) for all q ∈ R, and both carpets can be defined on the same m × n grid, on which condition (6) above holds.
This strengthens [46,Corollary 1.1], where it is assumed that Λ and Λ ′ are totally disconnected and defined on the same grid.In Example 2.14, we construct two carpets which we know are not bi-Lipschitz equivalent by Corollary 2.10, but where [46, Corollary 1.1] does not apply.Corollary 2.10 also shows in particular that if two carpets defined on the same grid with the same number of non-empty columns are bi-Lipschitz equivalent then the column sequence of one must be a permutation of the column sequence of the other (though we are not able to draw this conclusion if the number of non-empty columns is different, see Example 2.16).
One natural question would be to investigate the intermediate dimensions of self-affine carpets of Lalley and Gatzouras [37] or Barański [6], or higher-dimensional self-affine sponges.Indeed, in light of the recent paper [4] proving that the Assouad spectrum of Gatzouras-Lalley carpets (unlike Bedford-McMullen carpets) can be a differentiable function of θ, it is natural to ask whether the intermediate dimensions of Gatzouras-Lalley carpets can also be differentiable on (0, 1).We expect calculating a formula for the intermediate dimensions of such self-affine sets to be challenging, not least because there is no clear single analogue of the important quantity γ, and this is not something which we will explore.We remark, however, that after we posted this paper on arXiv, Huang et al. [31] introduced so-called box-counting measures of metric spaces and showed that these classes of self-affine carpets support such measures (indeed for Bedford-McMullen carpets they are simply the uniform Bernoulli measures).The authors proved (without any connectivity assumption and without using the intermediate dimensions) that the multifractal spectrum of box-counting measures is a bi-Lipschitz invariant.Their result therefore generalises both the result from [46] and our result on the bi-Lipschitz invariance of the multifractal spectrum.Motivated by Theorem 2.5, the authors also ask in [31, Open problem 1] whether two Gatzouras-Lalley or Barański carpets have the same intermediate dimensions if and only if their corresponding box-counting measures have the same multifractal spectra.

2.4.
Equivalent forms of the rate function.In this section we provide equivalent formulations of the rate function I(t) in terms of a pressure-like function, a certain probability vector with an entropy maximising property, and the multifractal spectra f ν (α) defined in (2.7).As a result, our main formula (2.5) for dim θ Λ can be expressed with any of these quantities.
We begin by defining the pressure-like function.For ı = (i 1 , . . ., i J ) ∈ {1, . . ., M } J and k ∈ {0, 1, . . ., J}, we introduce (2.10) In particular, for k = 0, ψ ı|0 (s) ≡ 1.The interpretation of ψ ı|k (s) later is that it gives the s-cost of a set in the cover with diameter related to k, see Remark 5.10.Moreover, we define the sum This is connected to the total s-cost of the optimal cover, see Remark 5.10 for additional explanation.To determine the critical exponent it is natural to define a pressure-like quantity as the exponential growth rate of Ψ J (s), more formally, (2.11) The probability vector Q * t ∈ P M is defined by It is well defined, see Lemma 3.2.Moreover, H(Q * t ) < log M since t > t.We regularly relate the arguments s and t to each other via the transformation We do so to ensure that which now follows from (2.10) and straightforward algebraic manipulations.Now, using (1.3) and (1.4), t maps to while t maps to Observe that by Jensen's inequality and non-uniform fibres, s < dim H Λ < dim B Λ < s.In Proposition 2.11, the key technical result of Section 2.4, we make a clear connection between (2.11), (2.12), (2.2) and (2.7) for pairs of (s, t) related by (2.13).The proof is non-trivial and is given in Section 3.
Proposition 2.11.Fix s ∈ (s, s).Then P (s) = P (s); let P (s) denote this common value.Furthermore, for every pair (s, t) related by (2.13), Note also that by (2.9) and standard properties of Legendre transforms, f ν and I can be written in terms of the Legendre transform of T ν .Remark 2.12.All figures of the graphs in this paper were created using Wolfram Mathematica 12.3, keeping simple implementation in mind rather than efficiency.For a fixed θ ∈ (0, 1), the value of dim θ Λ was approximated by taking 2 25 equally spaced points in the interval (dim H Λ, dim B Λ) and choosing the point s(θ) for which the expression in (2.5) was closest to 0. Remark 2.13.It was first observed in [35] that the graph θ → dim θ Λ can approach dim B Λ from below the straight line ℓ(θ) = dim H Λ + θ(dim B Λ − dim H Λ), indicating that it is possible for dim θ Λ not to be concave on the whole range of θ.From Corollary 2.3 it follows that in this case the graph θ → dim θ Λ must intersect ℓ(θ).In fact, there are even carpets where the graph intersects ℓ(θ) twice, as shown on the left of Figure 2.For the carpets in this figure, all parameters remain the same except for m, which causes different behaviour for larger values of θ as it changes.For m ≤ 25, the graph stays above ℓ(θ) for all θ.
where dim can be any of the Hausdorff, box, packing, Assouad, quasi-Assouad, lower, quasi-lower or modified lower dimensions, or the Assouad spectrum or lower spectrum for any fixed θ ∈ (0, 1).This holds since N = 106, max 3) and [28,Corollary 15.5.3] to show that the Hausdorff and modified lower dimensions are equal, and the formulae in [28] for the other dimensions.Therefore Λ and Λ ′ are not bi-Lipschitz equivalent but this is revealed only by the intermediate dimensions, not by any of the other dimensions mentioned above.If all the rectangles are chosen in a specific row, then neither Λ nor Λ ′ is totally disconnected, so [46, Corollary 1.1] does not apply.Figure 3 shows the plots of dim θ Λ (blue) and dim θ Λ ′ (orange) side-by-side on the left and the ratio dim θ Λ ′ / dim θ Λ on the right.
with the last inequality computed numerically using Theorem 2.1.Proposition 2.15.For any carpet with just two column types, meaning that M 0 = 2 using notation from Section 2.3, the rate function can be given explicitly by , where .
Proof.Let q = (q 1 , . . ., q M 0 ) ∈ P M 0 .It is straightforward to see that the supremum in (2.12) will not change if we restrict to vectors p ∈ P M of the form p î = q j /R j , if the î-th non-empty column has N j maps, (2.17) in other words measure is distributed uniformly amongst columns with the same number of maps.As a result, the linear constraints in (2.12) can be rewritten as In particular, since M 0 = 2, there is a single vector (q * 1 , q * 2 ) which satisfies (2.18), namely recalling N 1 > N 2 .Using (2.17), we can calculate the entropy of the entropy-maximising vector, and conclude from Proposition 2.11 that Then condition (6) from Theorem 2.5 holds, so dim θ Λ = dim θ Λ ′ for all θ ∈ [0, 1], despite the fact that the carpets are defined on the same grid with different parameters.This is only possible because the number of non-empty columns is different.
It is shown in [46] that the carpets in Example 2.16 are not bi-Lipschitz equivalent.Therefore equality of the intermediate dimensions is not a sufficient condition for two carpets with nonuniform fibres to be bi-Lipschitz equivalent, even if they are assumed to be defined on the same grid and totally disconnected.This raises the following question.
Question 2.17.Suppose two Bedford-McMullen carpets both have non-uniform fibres, are defined on the same grid, and are bi-Lipschitz equivalent.Does it follow that both carpets must have identical parameters (M 0 , N 1 , . . ., N M 0 , R 1 , . . ., R M 0 )?Example 2.18.Consider the two carpets Λ and Λ ′ with parameters Then it can be checked from Theorem 2.1 that dim θ Λ = dim θ Λ ′ for all θ ∈ [1/2, 1], but not for the whole range of θ; by Theorem 2.5 this is only possible because the carpets are defined on different grids.By Corollary 2.3, the graph of dim θ Λ has a phase transition at θ = 1/2 but the graph of dim θ Λ ′ does not, see Figure 4.

Proof of Proposition 2.11
Recall notation from Section 2. Assume s ∈ (s, s) and that (s, t) are related by (2.13).We prove Proposition 2.11 (giving the equivalent forms of the rate function) in four steps: Step 1: log n t + t γ + log M We will prove the steps in separate subsections, which will also contain some auxiliary results which are important in their own right in the proof of Theorem 2.1.

3.1.
Preliminaries.First, we need some preliminaries, in particular to describe the probability vectors P * t and Q * t which have certain optimising properties, and to recall some facts from the method of types.If k, k 1 , k 2 ∈ N satisfy 0 ≤ k 1 < k 2 ≤ k, and î ∈ {1, . . ., M } k , then we define the average Recall, P M denotes the set of probability vectors on [M ] = {1, . . ., M } and we introduced two distinguished probability vectors P := (N 1 /N, . . ., N M /N ) and Q := (1/M, . . ., 1/M ).Recall that the Kullback-Leibler divergence, also known as the relative entropy of p ∈ P M with respect to q ∈ P M is where we set 0 log 0 = 0 and 0 log(0/q î) = 0 regardless of the value of q î.It is asymmetric and H(p∥q) ≥ 0 with equality if and only if p = q.In particular, Recall that t := 1 M M ȷ=1 log N ȷ and t := log N − H(P), and let t ∈ (t, t).We divide the set P M into two parts: so that This is a linear system of equations for {q j } M 0 j=1 .Straightforward Gaussian elimination yields .
Thus, for every solution (q 1 , . . ., q M 0 ), we see that q 3 , . . ., q M 0 are free variables, and moreover and q 1 = 1−q 2 − M 0 j=3 q j .It now follows by a straightforward calculation that M 0 j=1 q j log N ′ j = t.By (3.2), the result follows.
□ We proceed to differentiate the relative entropy (with respect to a fixed vector q in the interior of P M ) along straight lines in P M .Fix p, q ∈ P M , and assume that all entries of q are positive.
where the sums are taken over all indices 1 ≤ î ≤ M for which p î + tv î > 0 for all t ∈ (−t − , t + ).Therefore t → H(p + tv∥q) is strictly convex, and has at most one minimum in [−t − , t + ].In particular, the uniqueness of P * t and Q * t follows from the convexity of G t and F t respectively.Note also that for all t ∈ (0, t + ), so t → H(q + tv∥q) is strictly increasing on (0, t + ).Applying this with q taken to be P or Q respectively gives that ), so there is equality throughout.□ The importance of choosing t to lie in the interval (t, t) (or equivalently s ∈ (s, s)) is that in this case the hyperplane E t separates P and Q.Otherwise, either H(P * t ∥P) = 0 or H(Q * t ∥Q) = 0, and (3.5) does not necessarily hold.
Method of types.The method of types is an elementary tool developed to study discrete memoryless systems in information theory.It has since found applications in hypothesis testing, combinatorics and large deviations (see [16] for some background).Kolossváry used it to calculate the box dimension and L q spectra of Gatzouras-Lalley and Barański type sponges in R d [36].
Let [M ] = {1, . . ., M } denote a finite alphabet and assume ı = (i 1 , . . ., i J ) ∈ [M ] J .For J ′ ≤ J, the type of ı at level J ′ is the empirical probability vector When J ′ = J, we simply write τ J (ı) := τ J J (ı).The set of all possible types of [M ] J is T J = p ∈ P M : there exists ı ∈ [M ] J such that p = τ J (ı) , and for J ′ ≤ J, the type class of p ∈ T J ′ amongst [M ] J is the set We use the following two simple facts: and for every type class see [18, Lemmas 2.1.2and 2.1.8].The importance of (3.6) is that #T J grows only polynomially in J; on the other hand, the exponential terms in (3.7) are the same in both the lower and upper bounds.Since we are looking for critical exponents, sub-exponential multiplicative terms do not influence our calculations.To simplify notation, we write f (J) ≍ g(J) if the exponential rates of growth of f (J) > 0 and g(J) > 0 exist and are equal to each other, so In particular, if f (J) is sub-exponential in J (for example when f (J) = #T J ), then f (J) ≍ 1.
The set T J is a discrete set with polynomially many points which becomes dense in P M as J → ∞.For p ∈ P M let p J denote the 'best approximation' of p in T J , in the sense that ∥p − p J ∥ = min q∈T J ∥p − q∥, where we can take any norm.If there are many such p J then we can choose the one with smallest coordinates when ordered lexicographically.For large enough J, ∥p − p J ∥ is arbitrarily small.In particular, property (3.7) and the continuity of the entropy imply that #T J (p J ) ≍ e J•H(p) .

Proof of
Step 1.This is a standard argument in large deviations theory, and in fact holds for all t ∈ (t, max 1≤i≤M log N i ).We include a sketch of it for the convenience of the reader.An alternative approach would be to use Lagrange multipliers.
Let I = I 1 , I 2 , . . .be an infinite sequence of independent and identically distributed random variables on the set {1, . . ., M } according to q ∈ P M .Let P q := q N denote the product measure corresponding to the distribution of the sequence I. Then τ J (I), the type of (I 1 , . . ., I J ), is a vector-valued random variable.For all p ∈ T J , (J + 1) −M e −J•H(p∥q) ≤ P q (τ J (I) = p) ≤ e −J•H(p∥q) , see [18, Lemma 2.1.9].Sanov's theorem [18,Theorem 2.1.10]shows that the family of laws P q (τ J (I) ∈ •) satisfies a large deviations principle with the rate function H(•∥q).In particular, for q = Q = (1/M, . . ., 1/M ) and the subset F t : Now define the random variable X ℓ := log N I ℓ and the averages Hence, by the 'contraction principle' [18, Section 4.2.1], the rate function In particular, Lemma 3.2 implies that

Proof of
Step 2. Since min k∈{0,1,...,J} ψ ı|k (s) ≤ min{1, ψ ı|J (s)}, recall the definition of ψ ı|k (s) from (2.10), Lemma 3.3.Assume t ∈ (t, max 1≤i≤N log N i ) and that (s, t) are related by (2.13).Then Proof.For any given word ı ∈ [M ] J , the average of the log N i ℓ does not depend on the particular order of the symbols in ı, just on the relative frequency of each symbol.In other words, only the type τ J (ı) = (τ J,1 (ı), . . ., τ J,M (ı)) of ı matters, and (recalling (2.14)) This reduces the problem back to a condition on probability vectors p ∈ P M .This is the reason why we introduced G t and F t the way we did in (3.3); we now see that We are now ready to determine the exponential rate of growth of the two terms in (3.8) separately by grouping together words according to type class.Let Q * t,J ∈ (F t ∩ T J ) be the type for which H(Q * t,J ) = max q∈(Ft∩T J ) H(q) (if there is more than one such vector then we can choose the smallest lexicographically).Then where we used (3.7) for the two inequalities.As J → ∞, the set T J becomes dense in P M , and as a result ) .An alternative way to see this would be to let X 1 , X 2 , . . ., X J , . . .be a sequence of i.i.d.random variables defined by (2.1).Then where we used (2.14) for the first equality, Cramér's theorem from large deviations theory for the asymptotic equality, and Step 1 for the final equality.□ Lemma 3.4.Assume s ∈ (s, s) and that (s, t) are related by (2.13). Then Proof.If ı ∈ T J (p), then Similarly to Q * t,J , let P * t,J ∈ (G t ∩ T J ) satisfy H(P * t,J ∥P) = min p∈(Gt∩T J ) H(p∥P).We have ψ ı|J (s) ≍ e J(−t+log N −H(P * t,J ∥P)) .
Using (3.5) and (3.2) in the exponent, −t , and the assertion follows.□ Note the importance of the assumption t < t in the proof of Lemma 3.4.Lemmas 3.3 and 3.4 and (3.8) immediately imply that P (s) ≤ H(Q * t ).
3.5.Proof of Step 4. This is an application of [32, Theorem 1], and in fact holds for all Indeed, by (2.6), for all λ, Taking the Legendre transform of each side and using standard properties of Legendre transforms and (2.2) and (2.7) proves Step 4. This completes the proof of Proposition 2.11.

Preliminaries to the proof of Theorem 2.1
Here we collect some notation and facts used in the proof of Theorem 2.1.Throughout the section, Λ is a Bedford-McMullen carpet with non-uniform fibres.
4.1.General theory.Following [13], for a bounded and non-empty set F ⊂ R d , θ ∈ (0, 1) and s ∈ [0, d], let us introduce The motivation for introducing S s δ,θ (F ) is that from [13, Lemma 2.1] and the definitions of dim θ F and dim θ F it follows that Proposition 4.1.Let F be a non-empty, bounded subset of R d , and let θ ∈ [0, 1], s ≥ 0, δ 0 ∈ (0, 1).Suppose that for all δ ∈ (0, δ 0 ) there exists a Borel measure µ δ with support supp(µ The same holds if we replace lim inf with lim sup. Proof. Since the cover was arbitrary, also µ δ (supp(µ δ )) ≤ S s δ,θ .The result follows.We define the symbolic spaces We use the convention that indices i corresponding to maps have a 'dot' while the indices î corresponding to columns have a 'hat' on top.To truncate i (respectively î) at the first n symbols we write i|n = i 1 i 2 • • • i n (respectively î|n).The longest common prefix of i and j is denoted by i ∧ j: its length is |i ∧ j| = min{ k : The function ϕ naturally induces the map Φ : Σ → Σ H defined by Slightly abusing notation, Φ is also defined on finite words: For compositions of maps, we use the standard notation n=1 form a nested sequence of compact sets with diameter tending to zero, hence their intersection is a unique point x ∈ Λ.This defines the natural projection Π : Σ → Λ, The coding of a point x ∈ Λ is not necessarily unique, but Π is finite-to-one.
It is not efficient to cover cylinder sets separately; instead they are grouped together to form 'approximate squares' which play the role of balls in a cover of the attractor.Recall, γ = log m n and for ℓ, K ∈ N let γ ℓ (K) := ⌊γ ℓ • K⌋.
In particular, we write γ(K) = γ 1 (K), and n It is a collection of level-γ(K) cylinder sets that lie in the same level-γ(K) column of a specific level-K cylinder set.In other words, Π(j) ∈ B K (i) if and only if |i ∧ j| ≥ K and |Φ(i) ∧ Φ(j)| ≥ γ(K).Hence, abusing notation slightly, we identify B K (i) with the single sequence The choice of γ(K) implies that there exists C ≥ 1 independent of K and i such that The constant C does not influence the behaviour of the s-cost of any cover with approximate squares.It is easy to see that two approximate squares are either disjoint, completely agree or intersect just on the boundary.Hence, the set of all level-K approximate squares, denoted by B K , gives an efficient n −K -cover of Λ with cardinality Lemma 4.2.For each fixed s ∈ R, the function T s (t) is strictly convex with a minimum at t, and satisfies T ′ s (t ′ ) = 1.Moreover, for all s ≥ dim H Λ and t ∈ R we have T s (t) ≥ t with equality if and only if s = dim H Λ and t = t ′ .
Proof.Since I(t) is strictly convex with a minimum at t, the same is true of T s (t) for each fixed s ∈ R, and the definition of t ′ implies that T ′ s (t ′ ) = 1.Using the formula (1.3) for dim H Λ and then that which is enough to complete the proof.□ Since I(t) is strictly increasing, let t * denote the unique solution to the equation Recall the notation for t ℓ (s) from (2.4).
Proof.Since I(t) = 0, we have t 1 (dim H Λ) = T dim H Λ (t).Also I ′ (t) < γ −1 = I ′ (t ′ ) and I is strictly convex, so t < t ′ .But T dim H Λ is strictly increasing, so where the last equality is by Lemma 4.2.
To prove t ′ < t * , for z ∈ R define Then after some algebraic manipulations, for all z ∈ [log m, log n) by Jensen's inequality, using that Λ has non-uniform fibres.Moreover, f is continuous on R, so f (log m) > f (log n) = 0, so  1) , and for δ > 0 we define K := ⌊ − log δ log n ⌋.We begin in Section 5.1 by constructing a simpler cover in the case when θ = γ −(L−1) in order to establish certain relations which are crucial in bounding the s-cost of our general cover in Section 5.3.Section 5.2 establishes the matching lower bound.

5.1.
Upper bound for θ = γ −(L−1) .In Lemma 5.2 we construct a cover for θ = γ −(L−1) .The proof strategy is to keep a level-K approximate square at level K if and only if τ (î, K, γ(K)) exceeds a constant τ 1 which remains unspecified for now (recalling notation from (3.1)).Of those which we subdivide, we keep them at level γ(K) if and only if τ (î, γ(K), γ 2 (K)) ≥ τ 2 .Continuing this process gives a cover of Λ using approximate squares at levels K, γ(K), . . ., γ L−1 (K) = ⌊K/θ⌋.This means that, up to some constant, all covering sets have diameter in the correct range [δ, δ 1/θ ].In Lemma 5.2 we calculate the s-cost of this cover for an arbitrary tuple, which will allow us to prove in Lemma 5.3 that the relevant t i (s) are bounded above by t, so results from Section 3 will apply.At the end we will optimise the thresholds so that the exponential rate of growth of each part is the same.The unique s for which this can be done gives us the upper bound for dim θ Λ.
If, on the other hand, t ∈ (min 1≤î≤M log N î, t), then lim sup Proof.The second part of the statement holds simply by the fact that there are M J strings of length J on the alphabet [M ], so we only prove the first part of the statement.The strategy for the upper bound is to work with an arbitrary type class and then use the fact that there are only polynomially many type classes.Note that if p ∈ T J and ȷ is any representative of the type class T J (p) then by Lemma 3.3 by Step 1 of Proposition 2.11 by the upper bound of (3.7).
For the lower bound, if q is the closest approximation in T J to Q * min{t,t} for which t q ≤ t, then by the lower bound of (3.7)
Therefore the first part of the statement of Lemma 5.1 holds.□ In order to calculate the s-cost of the cover we construct in the proof of Lemma 5.2, for τ = (τ 1 , . . ., τ L−1 ) ∈ (t, t) L−1 and s and for ℓ = 2, 3, . . ., L. In particular, when ℓ = L the sum is empty and (note the similarity with (4.4)).
Therefore the s-cost of U τ ℓ is by Lemmas 5.1 and 3.3 and algebraic manipulations.In the case l = L we used the convention that the empty product equals 1.
The symbolic representation of Therefore, as in (5.1), We have bounded the s-cost of each part of the cover, so the proof is complete.□ In (5.1) and (5.2) it was crucial that each τ i ∈ (t, t) when using Lemma 5.1.Lemma 5.2 tells us the exponential growth rate of the cover for all tuples τ , but motivated by (4.2), of particular interest is the case when The next lemma ensures that each of t 1 (s), . . ., t L (s) lies in the correct range (t, t).In particular, writing t := (t 1 (s), . . ., t L−1 (s)), we can then apply Lemma 5.2 to obtain the upper bound Then, using notation from (2.4) and (4.4), Proof.Recall from (2.15) and (2.16) that s < dim H Λ < s.It is therefore immediate that We now prove T dim H Λ (t * ) < t.To do so, we define, for every fixed p ∈ P M , the function Recall that Q = (1/M, . . ., 1/M ) and P = (N 1 /N, . . ., N M /N ).Clearly, f p (log n) = 0 for all p and f Q (z) = 0 for every z.The derivative of f p (z) with respect to z is while after some algebraic manipulations, we obtain that by Jensen's inequality with equality if and only if p = Q (here we use that p has strictly positive entries).Hence, for p ̸ = Q, f p (z) is a strictly convex function for all z > 0, and also f ′ p (log n) = 0, so f p (z) has a global minimum at z = log n.In particular, since m ̸ = n and P ̸ = Q as we assume the carpet has non-uniform fibres, f P (log m) > 0. Using formulae (1.3) and (1.4) for dim H Λ and dim B Λ, algebraic manipulations show that f But we can express I(t * ) from (4.4) and use the definition t := log N − H(P) to show that this is equivalent to the assertion T dim H Λ (t * ) < t, as required.
Recall that K = K(δ) = ⌊ − log δ log n ⌋.The measure will be defined by putting point masses on some carefully chosen level-⌊K/θ⌋ approximate squares (corresponding to the very smallest scale δ 1/θ ).
Because of the way µ is defined, the mass of all such squares will be the same.To calculate this mass, we need to count up the number of level-⌊K/θ⌋ approximate squares B ⌊K/θ⌋ (j) which lie inside the level-γ L−1 (K) square (so B ⌊K/θ⌋ (j) ⊂ B γ L−1 (K) (i)), and which also carry mass.
so indeed (5.13) holds for l.The proof is complete by induction.□ In Lemma 5.5 we prove that if we make R large enough then the mass is sufficiently evenly distributed for us to apply the mass distribution principle Proposition 4.1 in Section 5.4.Lemma 5.5.Let θ ∈ (0, 1) and s ∈ (dim H Λ, dim θ Λ].For all s ′ < s there exists δ 0 ∈ (0, 1) and R ∈ N depending on s, s ′ , θ and the carpet such that for all δ ∈ (0, δ 0 ) and k Proof.Fix θ ∈ (0, 1), s ∈ (dim H Λ, dim θ Λ] and R ∈ N. The idea is that for each scale k, we will choose from the finitely many scales considered in Lemma 5.4 the one which corresponds to the largest size that is smaller than n −k .We will then bound the number of approximate squares of this level which are contained in each level-k approximate square which carries mass, and use Lemma 5.4 to bound the mass of the level-k approximate square. Let J ′ ∈ N be large enough that for each t ∈ {t 1 (s), . . ., t L−1 (s)} and (s t , t) related by (2.13), (3.13) holds for all J ≥ J ′ and k ′ ∈ {1, . . ., J}.By Lemma 3.2, we may increase J ′ to assume further that if ı ∈ S t,J,R then J j=1 N îj ≤ e (t+1/R)J .Then (5.14) We may increase J ′ to ensure that for all J ≥ J ′ and k ′ ∈ {1, . . ., J}, letting l ′ ∈ {0, 1, . . ., R − 1} be such that ⌊l Let δ 0 > 0 be small enough that for all δ ∈ (0, δ 0 ), By decreasing δ 0 further we may assume by Lemma 5.4 that for all l ∈ {0, 1, . . ., L − 1}, We now consider symbolic representations of approximate squares in a similar way to Lemma 5.4.Case 1: Suppose l ∈ {0, 1, . . ., L − 2} and The symbolic representations of approximate squares B ⌊Kγ l+1−L θ −1 ⌋ (j) ⊂ B k (i) are as follows (broken onto two lines because they do not fit onto one line): , (j 1 , . . ., j γ l (K) , j γ l (K)+1 , . . ., j k equal , j k+1 , . . ., j K γ L−l−1 θ same column , and continuing ).
Therefore we can bound the mass where C is a constant depending only on the carpet, (5.17) is by (5.15) Therefore there is a constant C > 0 such that Therefore by the definition of t 1 (s) in (2.4) there is a constant C > 0 such that ).
Therefore by the definition of t 1 (s) there exists a constant C > 0 such that Therefore the result follows (using Lemma 5.4 if k ∈ {K, γ(K), . . ., γ L−1 (K)}) if we take R large enough depending on s, s ′ , θ, C and the carpet.□ We write and R ∈ N. The total mass Proof.The symbolic representation of a level-K approximate square ). Therefore • n −Ks by case l = 0 of (5.12) ≍ e K•G(θ,s)/(γ L θ) by (5.8),(2.4),(5.21),completing the proof.□ We have now proved enough to give Theorem 2.1 in the case when θ is a negative integer power of γ, see Section 5.4.

Upper bound for general
and 0 < δ ≪ 1.We define a cover {V j } j of Λ (depending on θ, s and δ) as follows.Every level-K cylinder will be covered in the same way, and the cover will consist of approximate squares (i 1 , . . ., i k , îk+1 , . . ., îγ(k) ) of different levels k ∈ {K, K + 1, . . ., ⌊K/θ⌋}.This means that the diameter of each element of the cover will, up to an irrelevant multiplicative constant depending only on the carpet, lie in the interval [δ 1/θ , δ].In fact, we will use only the scales γ l (K) and ⌊K/(γ l θ)⌋ for l ∈ {0, 1, 2, . . ., L − 1}. Figure 5 provides a diagram which may help the reader follow the construction of the cover.
Visualising the cover in (5.29) for L ≥ 3. Here, l denotes an arbitrary number in {1, 2, . . ., L − 2}.The indices of the symbolic representation and the lengths of the different parts are in black.Above the scales explicitly written out are the sets (in blue) which make up the part of the cover consisting of approximate squares of the corresponding level.The 'critical' thresholds t i for the averages of the different parts of the symbolic representation are in red.Recall that the t i depend on s, and the sets that make up the cover depend on s and θ.
If L = 1 then our cover is simply U 0,0 ∪ U 0,1 , so for the rest of the construction of the cover we assume that L > 1.
We will bound the s-cost of this cover in Lemma 5.9.For this, we need Lemmas 5.1, 5.7 and 5.8, which we prove using the method of types.The inequalities in Lemma 5.7 mimic (5.22) and (5.23).
The final step holds since so using standard properties of the rate function, the derivative of the exponent with respect to t q is negative.
By considering the symbolic representation of the approximate squares in such a cover, the s-cost is, up to multiplicative constants, by Proposition 2.11, where (s, t) are related by (2.13).Therefore the exponential growth rate of this s-cost is in fact the same as that of the cover constructed in Section 5.3 using just the two extreme scales K and ⌊K/θ⌋.

Proof of corollaries of Theorem 2.1
In this section we prove the corollaries and consequences of Theorem 2.1.
Proof of part (i).For define G(θ, s) by (5.21).Then G(θ, s) has continuous partial derivatives of all orders, so is C ∞ , on D.Moreover, the rate function I is analytic (as the Legendre transform of an analytic function) and compositions of analytic functions are analytic.It follows that for all (θ, s) ∈ D and (θ 1 , s 1 ) ∈ R 2 there exists r = r(θ, s, θ 1 , s 1 ) > 0 such that the function λ → G(θ +λθ 1 , s+λs 1 ) is real analytic for λ ∈ (−r, r).Therefore by a result of Siciak [47, Theorem 1], G(θ, s) is jointly analytic in (θ, s) ∈ D. Thus by the analytic implicit function theorem, the function θ → dim θ Λ (describing the zero set of G(θ, s)) is analytic for θ ∈ (γ −L , γ −(L−1) ).□ The next lemma gives a formula for the derivative.Recall, if θ ∈ (γ −L , γ −(L−1) ] then the formula for the intermediate dimension s , where I ′ denotes the derivative of the rate function I, and with the empty product defined to be 1.It follows that for Proof.We first show by induction on L that For L = 1, we have t 1 (s(θ)) = s(θ) − log M log m log n and A 1 (θ) = 1, so the claim holds.Assuming (6.4) for L − 1, we now prove for L: completing the proof of (6.4).
6.2.Proof of Corollary 2.2.We now use the fact that dim θ Λ is strictly increasing in θ to prove Corollary 2.2.
Proof of Corollary 2.2.Fix η > 0 small enough that dim H Λ + η < dim B Λ. Since dim θ Λ exists and is continuous in θ including at θ = 0 (see Theorem 2.1 and [23, Proposition 4.1]), we can fix θ 1 < 1/γ small enough that dim θ 1 Λ + η < dim B Λ. Let s ∈ (dim H Λ, dim θ 1 Λ + η], and for each δ ∈ (0, 1), let K = K(δ) ∈ N be such that n −K ≤ δ < n −(K−1) .For some string i, let B K,i ⌊K/θ⌋ denote the set of level-⌊K/θ⌋ approximate squares within the level-K approximate square B K (i).For each B K (i) it is more cost efficient (in terms of s-cost, up to irrelevant multiplicative constants depending only on Λ) to subdivide it into level-⌊K/θ⌋ approximate squares if and only if n −Ks ≥ #B K,i ⌊K/θ⌋ • n −sK/θ .(6.7) To determine #B K,i ⌊K/θ⌋ for some θ < 1/γ, we compare the sequences that define B K (i) and a level-⌊K/θ⌋ approximate square within it: ℓ=K+1 N îℓ .Substituting this back into (6.7),we get after algebraic manipulations that it is more cost-efficient to subdivide if and only if But since s ≤ dim θ 1 Λ + η, if is more cost-efficient to subdivide then the following condition for the average must hold: As θ → 0, the right-hand side tends to −∞, so there exists θ 0 < θ 1 /2 small enough that for all θ ≤ 2θ 0 it is more cost efficient not to subdivide any of the level-K approximate squares, if using only scales δ and δ 1/θ .Now, since dim θ Λ is strictly increasing in θ by Corollary 2.3, there exists ϵ < η small enough that dim θ 0 Λ + ϵ < dim 2θ 0 Λ.Then by the definition of θ 0 and since for all λ.A similar argument to the above using the generalised binomial theorem and Gelfond-Schneider theorem now gives that log m ′ log m ∈ Q.To show moreover that γ = γ ′ , note that these quantities are bi-Lipschitz invariants which depend only on the respective carpets, not the choice of iterated function system (see [29,Theorem 3.3]).So since m and m ′ are multiplicatively dependent, we can iterate the IFS to assume without loss of generality that Λ is defined on an m × n grid, and Λ ′ is defined on an m × n ′ grid, for the same m.Then by (2.6), Equating corresponding exponential bases in (6.9), applying (6.10) and using that the carpet has non-uniform fibres (so not all N î are equal) shows that n = n ′ .In particular, log n ′ log n ∈ Q, as required.□ Proof of Theorem 2.4.(1) The equality log n/ log m = log n ′ / log m ′ follows from observing the phase transitions of the Assouad spectrum (see [29,Theorem 3.3]) or intermediate dimensions.
The fact that log n/ log n ′ ∈ Q follows from Lemma 6.3.
(2) The forward implication follows from (1), and the backward implication holds by iterating the IFSs (recalling the discussion after the statement of Theorem 2.4).□ We now prove Theorem 2.5.Since the intermediate dimension and multifractal spectra obviously do not depend on the grid on which the carpet is defined, in light of Lemma 6.3 and Theorem 2.4 it suffices to assume henceforth that both carpets are defined on the same m×n grid to begin with.We already mentioned that the equivalence of (2) and ( 6) was proved in [46, Theorem 1.2].To complete the proof, we show that (1) ⇒ (3) ⇒ (5) ⇒ (6) ⇒ (4) ⇒ (6) ⇒ (5) ⇒ (1).Of these, the implication (1) ⇒ (3) is obvious.

Figure 1 .
Figure 1.Intermediate dimensions give finer geometric information about the fractal set.Left: a Bedford-McMullen carpet Λ in red and the shaded images of [0, 1] 2 under the iterated function system generating Λ. Right: certain bounds for the intermediate dimensions dim θ Λ in dashed orange, and the true value in blue obtained in this paper.

1. 1 .
Bedford-McMullen carpets.The construction of the carpet goes by splitting [0, 1] 2 into m columns of equal width and n rows of equal height for some integers n > m ≥ 2 and considering orientation preserving maps of the formf (i,j) (x) shows a simple example of a Bedford-McMullen carpet with distinct Hausdorff and box dimension.The three shaded rectangles show the image of [0, 1] 2 under the three maps in the IFS, while the attractor is shown in red.For this carpet, dim H Λ ≈ 1.34968 < 1.36907 ≈ dim B Λ. Let Λ be the Bedford-McMullen carpet associated to the IFS F. Fix notation

Question 2 . 9 .
In our setting X and Y are two Bedford-McMullen carpets with the Euclidean distance.The following open problem seems challenging: Find an explicit necessary and sufficient condition that determines, given two iterated function systems each generating a Bedford-McMullen carpet, whether or not the two carpets are bi-Lipschitz equivalent.

2. 5 .
Illustrative examples.The simplest example with non-uniform fibres is the one shown in Figure1.The following examples show additional interesting behaviour.

Figure 2 .
Figure 2. Parameters n = 100 and N = (51, 50, 50, 50, 50, 50) are the same in each example; only m varies from 30 on the left to 50 on the right.

2 ≈
We can use Hölder distortion to obtain a quantitative improvement of the assertion that Λ and Λ ′ are not bi-Lipschitz equivalent.Assume f : Λ ′ → R 2 is α-Hölder with f (Λ ′ ) ⊇ Λ.Then the optimal value of θ to consider is θ = γ −2 = log 2 log 3 0.40, see the right hand side of Figure3.Then by (1.1),

Figure 4 .
Figure 4. Plots of the intermediate dimensions of carpets in Example 2.18.

F ) − log δ = 0
and dim θ F = the unique s ∈ [0, d] such that lim sup δ↘0 log S s δ,θ (F ) − log δ = 0. (4.2) For each θ ∈ (0, 1), lim inf δ↘0 log S s δ,θ (F ) − log δ and lim sup δ↘0 log S s δ,θ (F ) − log δ are strictly decreasing and continuous functions of s.To bound S s δ,θ (Λ) from above, we construct an efficient cover of Λ in Section 5.3.The mass distribution principle is a useful tool to bound some dimension of a set from below by putting a measure on the set.For the matching lower bound, we will use the following version of the mass distribution principle for the intermediate dimensions of Falconer, Fraser and Kempton, [23, Proposition 2.2].

5. 4 .
Conclusion and discussion of the proof.We now conclude the proof of Theorem 2.1 by combining the upper bounds in Sections 5.1 and 5.3 and a lower bound from the mass distribution principle Proposition 4.1, which can be applied by virtue of the results in Section 5.2.Proof of Theorem 2.1.Fix θ ∈ (0, 1) and s