Polynomial-Time Perfect Matchings in Dense Hypergraphs

Similar documents
The Complexity of the Hamilton Cycle Problem in Hypergraphs of High Minimum Codegree

Matchings in hypergraphs of large minimum degree

MATCHINGS IN k-partite k-uniform HYPERGRAPHS

Packing k-partite k-uniform hypergraphs

Finding Hamilton cycles in robustly expanding digraphs

Not all counting problems are efficiently approximable. We open with a simple example.

VERTEX DEGREE SUMS FOR PERFECT MATCHINGS IN 3-UNIFORM HYPERGRAPHS

COMPUTATIONAL COMPLEXITY OF THE PERFECT MATCHING PROBLEM IN HYPERGRAPHS WITH SUBCRITICAL DENSITY

Generating p-extremal graphs

EXACT MINIMUM CODEGREE THRESHOLD FOR K 4 -FACTORS. MSC2000: 5C35, 5C65, 5C70. Keywords: Tiling, Hypergraphs, Absorbing method.

The Algorithmic Aspects of the Regularity Lemma

Total Ordering on Subgroups and Cosets

ON THE STRUCTURE OF ORIENTED GRAPHS AND DIGRAPHS WITH FORBIDDEN TOURNAMENTS OR CYCLES

arxiv: v2 [math.co] 20 Jun 2018

Generalized Pigeonhole Properties of Graphs and Oriented Graphs

Copyright 2013 Springer Science+Business Media New York

DIRAC-TYPE RESULTS FOR LOOSE HAMILTON CYCLES IN UNIFORM HYPERGRAPHS

Katarzyna Mieczkowska

Disjoint paths in unions of tournaments

Maximising the number of induced cycles in a graph

On the mean connected induced subgraph order of cographs

A hypergraph Turán theorem via lagrangians of intersecting families

1. Introduction Given k 2, a k-uniform hypergraph (in short, k-graph) consists of a vertex set V and an edge set E ( V

Avoider-Enforcer games played on edge disjoint hypergraphs

Some hard families of parameterised counting problems

Out-colourings of Digraphs

Irredundant Families of Subcubes

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Graph Theory. Thomas Bloom. February 6, 2015

FRACTIONAL CLIQUE DECOMPOSITIONS OF DENSE PARTITE GRAPHS

Quadruple Systems with Independent Neighborhoods

Ewan Davies Counting in hypergraphs via regularity inheritance

Compatible Hamilton cycles in Dirac graphs

Tight minimum degree conditions forcing perfect matchings in. matchings in uniform hypergraphs

The Turán number of sparse spanning graphs

Disjoint Hamiltonian Cycles in Bipartite Graphs

< k 2n. 2 1 (n 2). + (1 p) s) N (n < 1

arxiv: v2 [math.co] 7 Jan 2016

Automorphism groups of wreath product digraphs

Even Cycles in Hypergraphs.

Applications of the Szemerédi Regularity Lemma Shagnik Das

Packing and decomposition of graphs with trees

Asymptotically optimal induced universal graphs

Ramsey-type problem for an almost monochromatic K 4

On the number of cycles in a graph with restricted cycle lengths

New lower bounds for hypergraph Ramsey numbers

Graphs with large maximum degree containing no odd cycles of a given length

EXISTENCE AND UNIQUENESS OF INFINITE COMPONENTS IN GENERIC RIGIDITY PERCOLATION 1. By Alexander E. Holroyd University of Cambridge

GRAPH EMBEDDING LECTURE NOTE

Szemerédi s Lemma for the Analyst

RAINBOW MATCHINGS IN PROPERLY-COLOURED MULTIGRAPHS PETER KEEVASH AND LIANA YEPREMYAN. Mathematical Institute, University of Oxford.

Notes on the Matrix-Tree theorem and Cayley s tree enumerator

Proof of the (n/2 n/2 n/2) Conjecture for large n

Properties of θ-super positive graphs

MINIMALLY NON-PFAFFIAN GRAPHS

ON THE DECOMPOSITION THRESHOLD OF A GIVEN GRAPH

Discrete Mathematics

AN ALGORITHM FOR CONSTRUCTING A k-tree FOR A k-connected MATROID

On tight cycles in hypergraphs

Asymptotic enumeration of sparse uniform linear hypergraphs with given degrees

Dominating Set Counting in Graph Classes

Independent Transversals in r-partite Graphs

Packing and Covering Dense Graphs

Random Graphs III. Y. Kohayakawa (São Paulo) Chorin, 4 August 2006

A Linear Round Lower Bound for Lovasz-Schrijver SDP Relaxations of Vertex Cover

Proof of the 1-factorization and Hamilton Decomposition Conjectures. Béla Csaba Daniela Kühn Allan Lo Deryk Osthus Andrew Treglown

Disjoint paths in tournaments

Strongly chordal and chordal bipartite graphs are sandwich monotone

Course Notes. Part IV. Probabilistic Combinatorics. Algorithms

THE SZEMERÉDI REGULARITY LEMMA AND ITS APPLICATION

arxiv: v1 [math.co] 13 Dec 2014

The Strong Largeur d Arborescence

The number of edge colorings with no monochromatic cliques

arxiv: v1 [cs.ds] 2 Oct 2018

Advanced Topics in Discrete Math: Graph Theory Fall 2010

Learning Large-Alphabet and Analog Circuits with Value Injection Queries

9 - The Combinatorial Nullstellensatz

Testing Problems with Sub-Learning Sample Complexity

c 2010 Society for Industrial and Applied Mathematics

Least singular value of random matrices. Lewis Memorial Lecture / DIMACS minicourse March 18, Terence Tao (UCLA)

AALBORG UNIVERSITY. Total domination in partitioned graphs. Allan Frendrup, Preben Dahl Vestergaard and Anders Yeo

Bisections of graphs

How many randomly colored edges make a randomly colored dense graph rainbow hamiltonian or rainbow connected?

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

REGULARITY LEMMAS FOR GRAPHS

The regularity method and blow-up lemmas for sparse graphs

Counting independent sets of a fixed size in graphs with a given minimum degree

Combinatorial Optimization

Partitioning 2-edge-colored Ore-type graphs by monochromatic cycles

Santa Claus Schedules Jobs on Unrelated Machines

PRIMES Math Problem Set

Constructions in Ramsey theory

Tree-width and planar minors

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Decomposing oriented graphs into transitive tournaments

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Groups of Prime Power Order with Derived Subgroup of Prime Order

HAMILTON DECOMPOSITIONS OF REGULAR EXPANDERS: APPLICATIONS

HAMILTONIAN CYCLES AVOIDING SETS OF EDGES IN A GRAPH

1.1 Szemerédi s Regularity Lemma

Transcription:

Polynomial-Time Perfect Matchings in Dense Hypergraphs Peter Keevash School of Mathematical Sciences, Queen Mary, University of London London E 4NS United Kingdom p.keevash@qmul.ac.uk Fiachra Knox School of Mathematical Sciences, Queen Mary, University of London London E 4NS United Kingdom F.Knox@qmul.ac.uk Richard Mycroft School of Mathematics University of Birmingham Birmingham B3 4AF United Kingdom r.mycroft@bham.ac.uk ABSTRACT Let H be a k-graph on n vertices, with minimum codegree at least n/k + cn for some fixed c > 0. In this paper we construct a polynomial-time algorithm which finds either a perfect matching in H or a certificate that none exists. This essentially solves a problem of Karpiński, Ruciński and Szymańska, who previously showed that this problem is NPhard for a minimum codegree of n/k cn. Our algorithm relies on a theoretical result of independent interest, in which we characterise any such hypergraph with no perfect matching using a family of lattice-based constructions. Categories and Subject Descriptors Graph Theory Hyper- G.2.2 [Discrete Mathematics]: graphs, Graph Algorithms. Keywords Perfect Matchings; Lattices.. INTRODUCTION The question of whether a given k-uniform hypergraph (or k-graph) H contains a perfect matching (i.e. a partition of the vertex set into edges), while simple to state, is one of the key questions of combinatorics. In the graph case k = 2, Tutte s Theorem [8] gives necessary and sufficient conditions for H to contain a perfect matching, and Edmonds Algorithm [5] finds such a matching in polynomial time. However, for k 3 this problem was one of Karp s celebrated 2 NP-complete problems [6]. Results for perfect matchings have many potential practical applications; one example which has garnered interest in recent years is the Santa Claus allocation problem (see [3]). Since the general problem is intractable provided P NP, it is natural to seek conditions on H which render the problem tractable or even guarantee that a perfect matching exists. In recent years a substantial amount of progress has been made in this direction. One well-studied class of such conditions are Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. STOC 3 June -4, Palo Alto, California, USA. Copyright 203 ACM 978--4503-2029-0/3/06...$5.00. minimum degree conditions. In this paper we provide an algorithm that essentially eliminates the hardness gap between the sparse and dense cases for the most-studied of these conditions.. Minimum degree conditions Suppose that H has n vertices and that k divides n (we assume this throughout, since it is a necessary condition for H to contain a perfect matching). In the graph case, a simple argument shows that a minimum degree of n/2 guarantees a perfect matching. Indeed, Dirac s theorem [4] states that this condition even guarantees that H contains a Hamilton cycle. For k 3, there are several natural definitions of the minimum degree of H. Indeed, for any set A V (H), the degree d(a) of A is the number of edges of H containing A. Then for any l k, the minimum l-degree δ l (H) of H is the minimum of d(a) over all subsets A V (H) of size l. Two cases have received particular attention: the minimum -degree δ (H) is also known as the minimum vertex degree of H, and the minimum (k )-degree δ k (H) as the minimum codegree of H. For sufficiently large n, Rödl, Ruciński and Szemerédi [4] determined the minimum codegree which guarantees a perfect matching in H to be exactly n/2 k + c, where c {.5, 2, 2.5, 3} is an explicitly given function of n and k. They also showed that the condition δ k (H) n/k is sufficient to guarantee a matching covering all but k vertices of H (i.e. one edge away from a perfect matching). This provides a sharp contrast to the graph case, where a minimum degree of δ(g) n/2 εn only guarantees the existence of a matching covering at least n 2εn vertices. Many other minimum degree results for perfect matchings have also been proved; see the survey [2] for details, as well as recent papers [], [2], [9], [0], [] and [7]. Let PM(k, δ) be the decision problem of determining whether a k-graph H with δ k (H) δn contains a perfect matching. Given the result of [4], a natural question to ask is the following: For which values of δ can PM(k, δ) be decided in polynomial time? The main result of [4] implies that PM(k, /2) is in P. On the other hand, PM(k, 0) includes no degree restriction on H at all; as stated above, this was shown to be NP-complete by Karp [6]. Szymańska [6] proved that for δ < /k the problem PM(k, 0) admits a polynomial-time reduction to PM(k, δ) and hence PM(k, δ) is also NP-complete, while Karpiński, Ruciński and Szymańska [7] showed that there exists ε > 0 such that PM(k, /2 ε) is in P. This left a hardness gap for PM(k, δ) when δ [/k, /2 ε).

Main Result. In this paper we provide an algorithm which eliminates this hardness gap almost entirely. Moreover, it not only solves the decision problem, but also provides a perfect matching or a certificate that none exists. Theorem.. Fix k 3 and γ > 0. Then there is an algorithm with running time O(n 2kk+3 +k(k )+ ), which given any k-graph H on n vertices with δ k (H) (/k + γ)n, finds either a perfect matching or a certificate that no perfect matching exists. We remark that a more technical argument can reduce the running time of the algorithm to O(n 3k2 7k+ ). We give this argument in the full version of the paper..2 Lattices and divisibility barriers Theorem. relies on a result of Keevash and Mycroft [8] giving fairly general sufficient conditions which ensure a perfect matching in a k-graph. In this context, their result essentially states that if H is a k-graph on n vertices, and δ k (H) n/k + o(n), then H either contains a perfect matching or is close to one of a family of lattice-based constructions termed divisibility barriers. The latter play a key role in this paper, so we now describe them in detail. The simplest example of a divisibility barrier is the following construction, given as an extremal example in [4]: for a suitable choice of A, the k-graph formed by this construction has the highest minimum codegree of any k-graph on n vertices with no perfect matching. Construction.2. Let A and B be disjoint sets such that A is odd and A B = n, and let H be the k-graph on A B whose edges are all k-tuples which intersect A in an even number of vertices. To describe divisibility barriers in general, we make the following definition: for any k-graph H and any partition P of V (H) into d parts, we define the index vector i P (S) Z d of a subset S V (H) with respect to P to be the vector whose coordinates are the sizes of the intersections of S with each part of P (note that we consider a partition to include an implicit order on its parts, so that i P(S) is well-defined). We then define I P(H) to be the set of index vectors i P(e) of edges e H, and L P(H) to be the lattice (i.e. additive subgroup) in Z d generated by I P(H). A divisibility barrier is a k-graph H which admits a partition P of its vertex set V such that i P (V ) / L P (H); the next proposition shows that such an H contains no perfect matching (we omit the easy proof). To see that this generalises the construction above, let P be the partition into parts A and B; then L P (H) is the lattice of vectors (x, y) for which x is even, and A being odd implies that i P (V ) / L P (H). Proposition.3. Let H be a k-graph with vertex set V, and let P partition V such that i P (V ) / L P (H). Then H does not contain a perfect matching. A special case of the main theoretical result of this paper is the following theorem, which states that the converse of Proposition.3 holds for sufficiently large 3-graphs as in Theorem.. Thus we obtain an essentially best possible strong stability version of the result of Rödl, Ruciński and Szemerédi [4] in the case k = 3. Theorem.4. For any γ > 0 there exists n 0 = n 0 (γ) such that the following statement holds. Let H be a 3-graph on n n 0 vertices, such that 3 divides n and δ k (H) (/3+γ)n, which does not contain a perfect matching. Then there is a subset A V (H) such that A is odd but every edge of H intersects A in an even number of vertices. Theorem.4 can be used to decide PM(3, /3 + γ), as the existence of a subset A as in the theorem can be checked using (simpler versions of) the algorithms in Section 2. However, the case k = 3 is particularly simple because there is only one possible divisibility barrier; for k 4, the next construction shows that the converse of Proposition.3 does not hold for general k-graphs as in Theorem.. Construction.5. Let A, B and C be disjoint sets of vertices with A B C = n, A, B, C = n/3 ± 2 and A = B + 2. Fix some vertex x A, and let H be the k-graph with vertex set A B C whose edges are. any k-tuple e with e A = e B modulo 3, and 2. any k-tuple (x, z,..., z k ) with z,..., z k in C. Construction.5 satisfies δ k (H) n/3 k, so if k 4 then H meets the degree condition of Theorem.. Furthermore, it is not hard to see that i P(V (H)) L P(V (H)) for any partition P of V (H). In particular, if P is the partition of V (H) into A, B and C, then (0, 0, k), (,, k 2) and (, 0, k ) are all values of i P (e) for edges e H, and the above claim quickly follows in this case (recall that k n). However, H does not contain a perfect matching. To see this, let M be a matching in H, and note that any edge e M has e A = e B modulo 3, except for at most one edge of M which has e A = e B + modulo 3. So, letting (i, i 2, i 3 ) = i P (V (M)), we have i i 2 {0, } (modulo 3). Since this is not true of i P(V (H)), we conclude that V (M) V (H), that is, that M is not perfect..3 Approximate divisibility barriers Our starting point will be (a special case of) a result of Keevash and Mycroft [8] on approximate divisibility barriers. First we introduce the following less restrictive degree assumption that we will use for the rest of the paper; it is not hard to see that for small γ > 0 it follows from the assumption in Theorem.. (The reason for doing so will become clear at the end of Section 2.) δ (H) γn k, and () d(a) (/k + γ)n for all but at most εn k sets A of k vertices of H. The result from [8] states that under our degree assumptions, if H does not contain a perfect matching then we can delete o(n k ) edges from H to obtain a subgraph H for which there exists a partition P of V (H) such that i P(V (H)) / L P(H ). Thus if H is far from a divisibility barrier then it has a perfect matching. On the other hand, if H is itself a divisibility barrier then H does not have a perfect matching. New Result. The main theoretical contribution of this paper is to fill the gap between these cases, by giving a necessary and sufficient condition for the existence of a perfect matching under our degree assumptions. (2)

For the statement we need the following definitions. First, we say that a lattice L is transferral-free if it does not contain any vector with + in one co-ordinate, in another, and all remaining co-ordinates being zero. Second, we call a lattice L an edge-lattice if it is generated by vectors whose co-ordinates are non-negative and sum to k; thus L P (H) is an edge-lattice for any k-graph H and partition P. Theorem.6. For any k, γ, C 0, there exist ε = ε(k, γ, C 0 ) and n 0 = n 0 (k, γ, C 0 ) such that, for any C with 2k k+2 C C 0, any n n 0 divisible by k, and any k-graph H on n vertices satisfying () and (2), H has a perfect matching if and only if the following condition holds: (*) If P is a partition of V (H) into d parts, where d < k, and L Z d is a transferral-free edge-lattice such that any matching M in H formed of edges e H with i P(e) / L has size less than C, then there exists a matching M of size at most k 2 such that i P(V (H)\V (M )) L. Our algorithm for the decision problem is essentially an exhaustive check of condition (*) in Theorem.6, although we also need to provide an algorithm to efficiently list the partitions P as in the theorem. Thus Theorem.6 is required to prove correctness of the algorithm; we also believe it to be of independent interest. Our proof of Theorem.6 relies on the main result of [8] as well as a substantial amount of geometric, probabilistic and combinatorial theory..4 Contents and notation In the next section we present the algorithmic details of the results in this introduction. That is, we assume Theorem.6 and deduce Theorem.. In Section 3 we outline the proof of Theorem.6, presenting only the key ideas and steps, as the full proof is too long and technical to include here. In the final section we make some concluding remarks and note analogues of our main results pertaining to multipartite hypergraphs, which can be proved in a similar way. We write [r] to denote the set of integers from to r, and x y to mean for any y there exists x 0 such that for any x x 0 the following statement holds. Similar statements with more constants are defined similarly. Also, we write a = b ± c to mean b c a b + c. 2. ALGORITHMS AND ANALYSIS We start with the following theorem, which can be used to solve the decision problem of determining whether or not H has a perfect matching. Theorem 2.. Fix k 3 and γ > 0. Then there exists ε = ε(k, γ) such that for any k-graph H on n vertices which satisfies () and (2), Procedure DeterminePM determines correctly whether or not H contains a perfect matching. Furthermore, it will do so in time O(n 2kk+3 +k(k 2) ). Procedure DeterminePM is essentially an exhaustive check of condition (*) in Theorem.6. It is clear that the ranges of M, d, L and M in the procedure can be listed by brute force in polynomial time. However, brute force cannot be used for P, as there would be exponentially many possibilities to consider, so first we provide an algorithm to construct all possibilities for P. We imagine each vertex class V j to be a bin to which vertices may be assigned, and keep track of a set U of vertices Procedure DeterminePM Data: An integer k 3, a constant γ > 0 and a k-graph H = (V, E). Result: Determines correctly whether or not H has a perfect matching provided H satisfies () and (2) for ε = ε(k, γ, 2k k+3 ). if V < n 0(k, γ, 2k k+3 ) then Test every possible perfect matching in H, and halt with appropriate output. foreach matching M in H of size at most 2k k+2, integer d < k, transferral-free edge-lattice L Z d and partition P of V into d parts so that any edge e H which does not intersect V (M) has i P(e) L do if there is no matching M H of size at most k 2 such that i P (V \ V (M ) L then Output no perfect matching and halt. Output perfect matching and halt. yet to be assigned to a vertex class. So initially we take each V j to be empty and U = V (H). The procedure operates as a search tree; at certain points the instruction is to branch over a range of possibilities. This means to select one of these possibilities and continue with this choice, then, when the algorithm halts, to return to the branch point, select the next possibility, and so forth. Each branch may produce an output partition; the output of the procedure consists of all output partitions. An informal statement of our procedure is that we generate partitions by repeatedly branching over all possible assignments of a vertex to a partition class, exploring all consequences of each assignment before branching again. Furthermore, we only branch over assignments of vertices which satisfy the following condition. Given a set of assigned vertices, we call an unassigned vertex x reliable if there exists a set B of k 2 assigned vertices such that d(x B) (/k + γ)n. Lemma 2.2. Fix 0 < ε γ. Let H be a k-graph on a vertex set V of size n which satisfies () and (2), let d < k and let L Z d be a transferral-free edge-lattice. Then there are at most d 2k 2 partitions P of V such that i P(e) L for every e H, and Procedure ListPartitions lists them in time O(n k+ ). Proof. First we note that the instruction Assign x to V j in Procedure ListPartitions is well-defined. Indeed, since L is transferral-free, for any set S V (H) there is at most one j [k] such that i P (S) + u j L. Next we show that if the number of assigned vertices is at least (/k + γ)n and at most ( γ)n then there is always a reliable unassigned vertex. To see this, note that the number of sets x B, where x is unassigned and B is a set of k 2 assigned vertices, is at least γn ( ) n/k+γn k 2 > εn k. Hence some such x B has degree at least (/k + γ)n, and so x is reliable. The final line of the procedure ensures that any partition P of V (H) which is output has that property that i P (e) L for every e H. The converse is also true: any partition P of V (H) such that i P(e) L for every e H will be output by some branch of the procedure. To see this, consider the branch of the procedure in which, at each branch point, the vertex x under consideration is assigned to the vertex class in which it lies in P. By our initial remark, every other vertex of H must also be assigned to the vertex class in which

Procedure ListPartitions Data: A k-graph H and a transferral-free edge-lattice L Z d. Result: Outputs all partitions of V (H) with i P (e) L for every e H. Set U = V (H). Choose A V (H) of size k such that d(a) δn. Branch over all possible assignments of vertices in A. while U do if xy... y k H for some vertices x U and y,..., y k / U then if i P(y... y k ) + u j L for some j [k] then Assign x to V j and remove x from U. else Halt with no output. else Choose x U which is reliable; Branch over all possible assignments of x. if i P(e) L for every e H then halt with output P. it lies in P. We conclude that Procedure ListPartitions indeed runs correctly, returning all partitions P of V such that i P (e) L for every e H. It remains to bound the number of such partitions. Observe that after branching initially over all possible assignments of A, at least (/k + γ)n vertices will be assigned (all the neighbours of A) before the procedure branches again. Further, the procedure will no longer branch once there are fewer than γn unassigned vertices remaining. Indeed, in this case for any unassigned vertex x there are fewer than γn k edges containing x and another unassigned vertex. Thus condition () implies that every unassigned vertex x is contained in some edge xy... y k of H where y,..., y k are assigned. Hence when branching, we may always choose a reliable vertex as stated in the procedure. Consider some x over which the procedure branches. Then there can be no edge xy... y k of H where y,..., y k are assigned. Suppose that this is the case, and let B = y y 2... y k 2 be a set of assigned vertices such that d(x B) δn. (Such a B must exist since we chose x to be reliable.) None of the (/k+γ)n vertices v such that xvy... y k 2 is an edge of H can have been assigned, and each will be assigned before the next branch of the procedure. We conclude that after any branch in the procedure and before the next branch, at least (/k + γ)n vertices are assigned. Hence the search tree has depth at most k. Since the degree of the root of the search tree is at most d k and since the degree of every other vertex is the number of vertex classes d, it follows that the search tree has at most d 2k 2 leaf nodes. At most one partition is output at each leaf node, so at most d 2k 2 partitions P will be output by the algorithm, as required. Furthermore, over all branches there will be at most d 2k 2 n iterations of the while loop, and the condition of the first if statement takes O(n k ) operations to check, and so the overall running time is O(n k+ ). Proof of Theorem 2.. Fix k 3 and 0 < ε γ, and let H be a k-graph on a vertex set V of size n which satisfies () and (2). We first show that Procedure DeterminePM determines correctly whether or not H has a perfect matching. This is trivial if n < n 0 = n 0 (k, γ, 2k k+3 ), so assume without loss of generality that n n 0. Suppose first that H does not contain a perfect matching. Then by Theorem.6 applied with C = 2k k+2 there exists a partition P of V into d parts, where d < k, and a transferral-free edge-lattice L Z d such that (i) any matching M in H formed of edges e H with i P(e) / L has size less than 2k k+2, and (ii) no matching M in H of size at most k 2 has i P (V \ V (M )) L. Let M be a maximal matching in H formed of edges e H with i P(e) / L, so M < 2k k+2. By maximality of M any edge e H which does not intersect V (M) has i P(e) L. Therefore, Procedure DeterminePM will consider M, d, and L and P in some iteration, and will then find that no matching M H of size at most k 2 has i P (V \V (M )) L. Hence the procedure will output that H does not contain a perfect matching, as required. Now suppose that H does contain a perfect matching, and suppose for a contradiction that Procedure DeterminePM incorrectly claims that this is not the case. This can only arise if Procedure DeterminePM considers a matching M in H of size at most 2k k+2, an integer d < k, a transferralfree edge-lattice L Z d and a partition P of V into d parts so that any edge e H which does not intersect V (M) has i P(e) L, and finds that no matching M H of size at most k 2 has i P(V \ V (M )) L. Since any edge e H with i P (e) / L must intersect V (M), any matching in H formed of edges e H with i P (e) / L has size at most k M 2k k+3. So P, d and L are as in condition (*) of Theorem.6 with C = 2k k+3 ; since H has a perfect matching this is a contradiction. It remains only to show that Procedure DeterminePM must terminate in polynomial time. To see this, note that there are at most n k 2kk+2 choices of matchings M, and these can be generated in time O(n 2kk+3 ) by considering each set of at most 2k k+2 edges in turn. Also, there are only a constant number of choices for d and L, and these can be generated in constant time. Indeed, since L is an edge-lattice, it is generated by vectors with non-negative coordinates which sum to k; the number of such generating sets is bounded by a function of k. Lemma 2.2 applied to H \ V (M) shows that the number of choices for P is also constant, and the list can be generated in time O(n k+ ). Finally, it takes time O(n k(k 2) ) to evaluate the truth of the condition of the central if statement. We conclude that in any case this procedure will run in time O(n 2kk+3 +k(k 2) ), as required. Now we will deduce our main result, Theorem.. We start by using Procedure DeterminePM to check whether H contains a perfect matching. If H has no perfect matching then this is certified by some M, L and P as in the procedure. So suppose that H does contain a perfect matching. How can we find it? A naive attempt at a proof is the following well-known idea. We examine each edge e of H in turn and use the same procedure to test whether deleting the vertices of e would still leave a perfect matching in the remainder of H, in which case we say that e is safe. There must be some safe edge e, which we add to our matching, then repeat this process, until the number of vertices falls below n 0, at which point our procedure no longer works and we resort to a constant-time brute force search.

The problem with this naive attempt is that as we remove edges, the minimum codegree may become too low to apply Procedure DeterminePM, and then the process cannot continue. To motivate the solution to this problem, suppose that we have oracle access to a uniformly random edge from some perfect matching. Such an edge is safe, and if we repeatedly remove such random edges, standard large deviation estimates show that with high probability the minimum codegree condition is preserved (replacing γ by γ/2, say). As an aside, we note that since Linear Programming is in P, we can construct a distribution (p e) on the safe edges such that e:x e p e = k/n for every vertex x; using this distribution instead of the oracle provides a randomised algorithm for finding a perfect matching. Our actual algorithm is obtained by derandomising the oracle algorithm. Instead of a minimum codegree condition, we bound the sum of squares of codegree deficiencies, which is essentially the condition (2) considered above. We also need to introduce the vertex degree condition (), otherwise we do not have an effective bound on the number of partitions P in Lemma 2.2. Conditions (i) and (ii) in the following lemma effectively serve as proxies for (2) and (). Lemma 2.3. Suppose that ε ε(k, γ) and n n (k, γ). Let V be a vertex set of size n and let H be a k-graph on V. Set t A = max(0, (/k + γ)n d(a)) for each set A of k vertices of H. Suppose that (i) A ( V k ) t2 A < εγ 2 n k+ /4, (ii) n ( n k 2) /3k δ (H)+ A ( V k ) t2 A/ εγ 2 n 2 < εn k, (iii) H contains a perfect matching. Then we can find, in time O(n 2kk+3 +k(k ) ), an edge e H such that (i), (ii) and (iii) also hold for H \ e with n k in place of n. The proof of Lemma 2.3 involves messy calculations, so we just describe the idea. While δ (H) > n ( n k 2) /3k we only need to maintain condition (i); then an averaging argument shows that the required edge exists. On the other hand, if there is a vertex of small degree we can remove any edge containing it: this so greatly decreases A ( k ) V t2 A as to compensate for any further decrease in δ (H). Proof of Theorem.. We begin by running Procedure DeterminePM to confirm that H contains a perfect matching; if it does not, then we obtain a matching M in H of size at most 2k k+2, a transferral-free lattice L and a partition P of V (H) such that L P (H \ V (M)) L, but i P (V \ V (M )) / L for any matching M in H of size at most k 2, providing a certificate that no perfect matching exists. If H does contain a perfect matching, then we proceed by using repeated applications of Lemma 2.3 to delete edges of H (along with their vertices). Condition (iii) of Lemma 2.3 is satisfied by assumption and conditions (i) and (ii) follow easily from the codegree condition on H. Since Lemma 2.3 ensures that its conditions are preserved after an edge is deleted, we may repeat until n < n (k, γ). At this point we use the brute-force algorithm to find a perfect matching in the remainder of H. Together with the deleted edges this forms a perfect matching in H. 3. OUTLINES OF THE PROOFS In this section we sketch the proof of Theorem.6, which provides the theoretical basis for our algorithm. 3. Edge-detection lattices We start by explaining and stating the theorem of Keevash and Mycroft on approximate divisibility barriers. Given a k-graph H and a partition P of V (H), the lattice L P (H) can be seen as detecting where edges of H lie with respect to P. However, the information conveyed by L P (H) is by itself insufficient, as shown by the k-graph formed in Construction.5. Indeed, in that instance L P (H) was complete, but some index vectors did not represent enough edges: specifically, H did not contain two disjoint edges with different numbers of vertices in A and B modulo 3. Thus in the proof of Theorem.6 we will frequently want to know which index vectors are represented by many edges. This leads to two important definitions analogous to those of I P (H) and L P (H): we define I µ P (H) to be the set of index vectors i for which at least µn k edges e H have i P(e) = i, and then we define L µ P (H) to be the lattice in Zd generated by this set (where d is the number of parts of P). So I µ P (H) and L µ P (H) reflect how the edges of H lie with respect to P with weaker detection of edges. Note that for any µ < µ we have L µ P (H) Lµ P (H) LP(H). We say that the lattice L µ P (H) for a k-graph H is complete if it contains all vectors in Z d whose co-ordinates sum to k. The point of this definition is that if L µ P (H) is complete then we must have i P(V ) L µ P (H) (recall that k n), so to form a divisibility barrier we would have to delete at least µn k edges. The following theorem is a consequence of a more general result of Keevash and Mycroft [8]. Theorem 3.. (Keevash and Mycroft [8]) Suppose that /n ε, µ γ, /k, and let H be a k-graph on a vertex set V of size n which satisfies the degree conditions () and (2). If L µ P (H) is complete for every partition P of V into parts of size at least n/k then H contains a perfect matching. 3.2 Fullness Next we explain our earlier definition of transferral-free lattices and the associated concept of fullness. Let H be a k-graph with a partition P of V (H) such that L µ P (H) is incomplete. For any part X P, write u X for the index vector with respect to P which is on X and zero on every other part of P. Suppose that L µ P (H) contains ux uy, for some X Y P, and let P be the partition formed from P by merging the parts X and Y. Then it is not hard to see that L 2µ P (H) is also incomplete. To say that L µ P (H) is transferral-free is then to say that no such merging is possible; that is, u X u Y / L µ P (H) for any parts X Y of P. So we can view a partition which gives rise to a transferral-free lattice as the simplest version of a given approximate divisibility barrier. We say that an edge-lattice L with respect to P is full if it is transferral-free and for each index vector i of a (k )- set, there is a (unique) part X such that i + u X L. It is not hard to show that if H satisfies () and (2) and L µ P (H) is transferral-free, then Lµ P (H) is also full. The following lemma expresses an important property of full lattices, namely that they are subgroups of finite index in the maximal lattice L max P of vectors in Z P with co-ordinate sum divisible by k.

Lemma 3.2. Let k 3 and suppose L is a full edge-lattice with respect to a partition P of a set V. Then (i) For any i L max P and X P there is X P such that i u X + u X L, (ii) L max P /L P. Proof. We first show that: (+) for any X, X, X 2 P, there exists X 2 P such that u X + u X2 u X u X 2 L. To see this, fix any index vector i of a (k 3)-set in V. Since L is full, we can find Y P such that i + u X + u X2 + u Y L. Similarly, we can find X 2 P such that i + u X + u Y + u X 2 L. Then u X + u X2 u X u X 2 is the difference of these two index vectors and hence lies in L. To prove (i), consider i L with Z P i Z = Z P i Z that minimises Z P i Z i Z subject to this condition. Note that Z P i Z i Z 2. For suppose otherwise, and choose X, X, X 2 such that i X i X > 0, i X2 i X 2 > 0 and i X i X < 0 (or i X i X > and i X i X < 0 if X = X 2 ). Using (+), let X 2 P be such that i = u X + u X2 u X u X 2 L. Then i + i contradicts our choice of i. It follows that i = i u Y + u Y for some Y, Y P. Using (+) again, we can choose X such that i = u X + u Y u X u Y L. Therefore i + u X u X = i + i L, as claimed. To prove (ii), fix any index vector i of a (k )-set in V. We claim that every coset L + v of L in L max P contains an index vector i + u X for some X P; this clearly suffices to prove the lemma. To see this, note that since I is full there exists X P such that i + u X L. By the previous claim, we obtain X P such that v u X + u X L. But now i + u X = (i + u X) + ( v u X + u X ) + v L + v, as required. 3.3 The key lemma and robust maximality A key part of the proof of Theorem.6 is Lemma 3.4, which we shall state after some motivation and definitions. This lemma generalises Theorem 3. in two ways. First, instead of the condition of Theorem 3. that L µ P (H) must be complete, we now only require that i P (V ) L µ P (H) (as discussed earlier, this must be true if L µ P (H) is complete). Furthermore, whereas the condition of Theorem 3. must hold for any partition P of V (H) into sufficiently large parts, we now only require that i P(V ) L µ P (H) for a single partition P which meets two additional requirements. The first requirement is that every vertex v V must lie in many edges e H with i P(e) L µ P (H). This condition can be seen as ensuring that each vertex of H lies in the correct part of P. For example, if we fix µ > 0 and take the k-graph from Construction.2 and move a single vertex from part A to part B (but do not change the edge set of H), then the only edges whose index changes are the fewer than n k edges which contain v. So L µ P (H) is unchanged, and H doesn t have a perfect matching (since H itself is unchanged), but we now have i P (V ) L µ P (H), due to v being in the wrong part of P. Secondly, we must assume that L µ P (H) is transferral-free. However this requirement, while necessary, is not sufficient, as the following example will show. Fix k 5 and suppose that P divides V into two parts, W and W 2. Further, let Q be a refinement of P which divides W into V and V 2 and W 2 into V 2 and V 22. Suppose further that W is even, but that V V 2 is odd. Now let H be the k-graph on V whose edges are precisely the k-subsets of V which contain an even number of vertices in W and an even number of vertices in V V 2. It is easy to see that L µ P (H) is full, that δ k (H) (/k + γ)n and that i P (V ) L µ P (H). In this case, the conditions relating to P do not preclude the existence of a perfect matching, but the conditions relating to Q do. Indeed, H cannot contain a perfect matching since it is a subgraph of the k-graph described in Construction.2, where A = V V 2 and B = V 2 V 22. To avoid this kind of situation, we insist that there is no strict refinement of P into not-too-small parts such that L µ P (H) is transferral-free. Note that the trivial partition into a single part satisfies this requirement if and only if H is not close to a divisibility barrier. However, being maximal transferral-free is a rather fragile property, that can be destroyed by even a small change in µ or alteration to H. In the course of our proof we will need to remove small matchings from H in order to cover vertices which are exceptional in various ways. We also need a property which is preserved (with high probability) when H is replaced by an induced subgraph on a randomly chosen set of vertices. Thus we require a stronger property, namely that for some µ µ (i.e. even at a much weaker detection threshold ) the lattice L µ Q (H) is not transferral-free for any strict refinement Q of P into not-too-small parts. Together these considerations lead to the following key definition of robust maximality. Definition 3.3. Let H be a k-graph on a vertex set V of size n. We say that a partition P of V is (c, µ, µ )-robustly maximal with respect to H if (i) L µ P (H) is transferral-free, and (ii) for any partition P + of V which strictly refines P into parts of size at least cn, the lattice L µ (H) is not P transferral-free. + We can now state the key lemma. We discuss its proof later, but first we will analyse the property of robust maximality in more detail, and describe how Theorem.6 follows from Lemma 3.4. Lemma 3.4. Suppose that /n ε µ µ c, d, γ /k, and let H be a k-graph whose vertex set V has size n and which satisfies the degree condition (2). Also let P be a partition of V with parts of size at least (/k + γ)n which is (c, µ, µ )-robustly maximal with respect to H. Suppose that (i) for any vertex x V there are at least dn k edges e H with x e and i P (e) L µ P (H), and (ii) i P(V ) L µ P (H). Then H contains a perfect matching. 3.4 Properties of robust maximality Lemma 3.4 will only be useful if we can actually find a (c, µ, µ )-robustly maximal partition of the vertex set of a k-graph H for some small constants µ, µ and c with µ µ c. This is achieved by the following proposition, which even allows us to refine any given partition P to a robustly maximal partition. The proof is straightforward; we repeatedly refine P into partitions with parts of size at least cn which give rise to transferral-free lattices. When this is no longer possible, the final refinement we obtain will be robustly maximal by definition.

Proposition 3.5. Let k 2 be an integer and c > 0 be a constant. Let s = /c and fix constants 0 < µ < < µ s+. Suppose that H is a k-graph on a vertex set V of size n, and P is a partition of V with parts of size at least cn such that L µ P (H) is transferral-free. Then there exists t [s] and a partition P of V with parts of size at least cn which refines P and is (c, µ t, µ t+)-robustly maximal with respect to H. The next proposition demonstrates two important inheritance properties of robust maximality. Namely, if P is a robustly maximal partition of the vertex set V of a k-graph H, and we form a subgraph H H either by deleting only a small number of vertices and edges from H, or by restricting H to a random subset of V, then (the restriction of) P will be robustly maximal with respect to H. Actually, we prove a significantly stronger version of (ii), allowing us to specify how many vertices of S should be taken from each part of a partition Q of V. Proposition 3.6. Suppose that /n /n µ µ, α c, /k. Let H be a k-graph on n vertices with m edges, and P be a (c, µ, µ )-robustly maximal partition of V (H) with respect to H, with parts of size at least cn. Then: (i) If H is a subgraph of H with at least ( α)n vertices and at least m αn k edges, then the restriction of P to V (H ) is a (c + 2α, µ + 2α, µ α)-robustly maximal partition with respect to H. (ii) Suppose that a set S V (H) of size n is chosen uniformly at random. Then with probability o() the restriction of P to S is a (2c, µ/c, (µ ) 3 )-robustly maximal partition with respect to H[S]. Proof sketch. For (i) we simply count how many edges of any given index can be removed in forming H, and the result follows. The first part of (ii) is also straightforward: a standard Chernoff bound shows that condition (i) of Definition 3.3 holds for the restriction of P with high probability. A similar argument shows that condition (ii) of Definition 3.3 holds for any specific partition P + which refine this partition, but unfortunately there are too many possibilities for P + to apply a union bound. Instead we proceed by a technical argument using weak hypergraph regularity. 3.5 The proof of Theorem.6 Between Lemma 3.4 and Prop.3 we are moving towards a characterisation of k-graphs H which satisfy the degree conditions () and (2). Indeed, fix such an H and suppose that P is a (c, µ, µ )-robustly maximal partition of V := V (H) with parts of size at least cn such that every vertex lies in many edges with i P (e) L µ P (H). Then by Proposition.5 H cannot contain a perfect matching if i P (e) / L P (H). On the other hand, if i P (e) L µ P (H) then H contains a perfect matching by Lemma 3.4. The idea of the proof of Theorem.6 is that we now ask whether it is possible to delete a matching M of size at most k 2 from H so that i P(V \V (M)) L µ P (H). If so, we may delete the vertices covered by M from H to form a k- graph H, and the restriction of P to V (H ) is (2c, 2µ, µ /2)- robustly maximal with respect to H by Proposition 3.6. So Lemma 3.4 implies that H contains a perfect matching, and together with M this gives a perfect matching in H. On the other hand, if H contains a perfect matching M then i P (V \ V (M )) = 0, so certainly i P (V \ V (M )) L µ P (H); we will see that there is a submatching M M of size at most k 2 such that i P (V \ V (M)) L µ P (H). Putting the two together gives the desired characterisation of whether a k-graph H which satisfies the degree conditions contains a perfect matching. More precisely, let H be a k-graph whose vertex set V has size n, and which satisfies the degree conditions () and (2). Suppose first that H contains a perfect matching M. Let P be a partition of V into d < k parts, and L Z d be a transferral-free edge-lattice such that any matching M in H formed of edges e H with i P (e) / L has size less than C. Certainly we must then have L µ P (H) L, from which we deduce that L is full, and so has index at most k in L max P by Lemma 3.2(ii). Next we require the following lemma, which is a simple application of the pigeonhole principle. Lemma 3.7. Let G = (X, +) be an abelian group of order m, and suppose that elements x i X for i [r] are such that i [r] x i = x. Then i I x i = x for some I [r] with I m. This implies that we can find a matching M in H of size at most k 2 for which i P (M ) lies in the same coset of L (in L max P ) as i P (M ); since i P (V \ V (M )) = 0 L we deduce that i P (V \ V (M )) L, so M satisfies the requirement of condition (*) of Theorem.6. This completes the proof of the simpler direction of Theorem.6. To prove the other direction of Theorem.6, namely that condition (*) implies that H contains a perfect matching, we begin by applying Proposition 3.5 to obtain a partition P of V which is (c, µ, µ )-robustly maximal with respect to H. Since H has high vertex degree, all but a small number of vertices v V lie in many edges e H with i P(e) L µ P (H); we can ensure that this condition holds for all vertices v V by moving these bad vertices to a different part of P. We continue writing P for the altered partition; Proposition 3.6 implies that P is still (c, µ, µ )-robustly universal for a slightly larger c and µ and a slightly smaller µ. Now let I = I µ P (H) and L = Lµ P (H), form I by adding to I any index vector i with respect to P for which H contains at least 2k 2 disjoint edges e H with i P (e) = i, and let L be the lattice generated by I (so L L ). It may well be the case that L is not transferral-free; but by merging any parts X, Y of P for which L contains the vector u X u Y we obtain a new partition P of V into fewer than k parts and a new lattice L which is transferral-free. Now, since there are at most k k possible values of i P(e) for an edge e H, it follows from our choice of I that any matching of edges e H such that i P (e) / L has size less than 2k k+2 C. So L and P satisfy the requirements of condition (*) of Theorem.6, from which we deduce that H contains a matching M of size at most k 2 such that i P (V \ V (M )) L. From this it follows that i P (V \ V (M )) L. By the definition of I, when a set of fewer than 2k 2 vertices is deleted from H there will remain, for every i added to I to form I, an edge e such that i P(e) = i. Using this fact along with Lemma 3.7, we may greedily choose a small matching M in H \ V (M ) such that i P(V \ V (M M )) L = L µ P (H). Form H by deleting vertices covered by M or M from H; then by Proposition 3.6 the restriction of P to V (H ) is (2c, µ/c, (µ ) 3 )-robustly maximal with respect to H. So H satisfies the conditions of Lemma 3.4 and so contains

a perfect matching; together with M and M this gives a perfect matching in H. 3.6 Proof of the key lemma Rather than prove Lemma 3.4 directly, we first prove the following version of Lemma 3.4 for k-partite k-graphs H. We say that a k-graph is k-partite if there is a partition of its vertex set into vertex classes V,..., V k such that every edge of H intersects each vertex class in a single vertex. Similarly, we say that a set S of k vertices from such a graph is k-partite if it intersects each vertex class in at most one vertex. Lemma 3.8. Suppose that /n ε, µ µ c, d γ, /k and l k, and let H be a k-partite k-graph each of whose k vertex classes has size n such that at most εn k k-partite sets A of k vertices have d(a) < n/l + γn. Also let P be a partition of V (H) which refines the partition into vertex classes into parts of size at least cn and which is (c, µ, µ )-robustly maximal with respect to H. Suppose that (i) for any vertex x V there are at least dn k edges e H with x e and i P(e) L µ P (H), and (ii) i P (V ) L µ P (H). Then H contains a perfect matching. To deduce Lemma 3.4 for a (non-partite) k-graph H, we take a random k-partition of V (H) into vertex classes of size n/k. A technical argument using weak hypergraph regularity then shows that the conditions of Lemma 3.8 (with l = k) are satisfied with positive probability, and we apply Lemma 3.8 to deduce that H contains a perfect matching. It remains to prove the k-partite form, Lemma 3.8. One key idea for this proof is the next proposition. For any k- graph H on n vertices, any partition P of V (H) and any index vector i I µ P (H), there are at least µnk edges e H with i P (e) = i. However, for the k-graphs H and partitions P which we consider we can say much more. For each i I µ P (H), we let H i be the k-partite subgraph of H on the vertex set W P,i W = W, whose edges are the edges in H of index i. Proposition 3.9. Suppose that /n µ, ε ε δ, c, /k. Let H be a k-partite k-graph whose vertex classes V,..., V k each have size cn V i n, and in which at most εn k k-partite sets S of k vertices have d(s) < δn. Also let P be a partition of V (H) into parts of size at least cn which refines the partition into vertex classes and has the property that L µ P (H) is transferral-free. (i) For any i I µ P (H) there are at least δck n k /2 edges e H with index i P (e) = i. (ii) For any i I µ P (H), at most ε n k k-partite sets S of k vertices of H i have d Hi (S) < (δ ε )n. (iii) Each part of P has size at least (δ ε )n. Proof. For (ii), let W V,..., W k V k be the parts of P such that i W = (so V (H i ) = j [k] W j). Consider the k-partite sets S = {x,..., x k } with x j W j for each j. By assumption, at most εn k such sets S have d H (S) < δn. Furthermore, if S satisfies d H (S) δn but d Hi (S) < (δ ε )n, then S is contained in at least ε n edges e H with i P (e) / I µ P (H) (since Lµ P (H) is transferral-free). Since there are at most /c k possible index vectors i P(e) for an edge e H, there are at most µ(kn) k /c k such edges of H. We therefore conclude that at most µ(kn) k /c k ε n ε n k sets S have this form, completing the proof of (ii). We immediately deduce (iii). Since there are at least (cn) k choices for S, (iii) implies in particular that H i contains at least ((cn) k ε n k )(δ ε )n c k δn k /2 edges, and so we also have (i). What this proposition tells us is that if H and P satisfy the conditions of Lemma 3.8, then for any i I µ P (H) the subgraph H i satisfies a similar degree condition to H. In fact, if P is non-trivial then the degree condition on H i is in a sense stronger than that on H. Indeed, in this case Proposition 3.9(iii) applied with δ = /l + γ implies that each part of V (H i ) has size at most ( /l)n. So when Proposition 3.9(ii) states that all but at most ε n k k-partite sets S of k vertices have d(s) (/l + γ ε )n, this is out of a maximum of ( /l)n vertices. Hence the proportion of possible neighbours of S which are in fact neighbours of S is at least /l+γ/2 + γ. So expressed as a proportion, /l l 2 the degree of most sets of k vertices in H i is significantly greater than in H. This suggests the method of proof of Lemma 3.8: we proceed by induction on l. For the base case l = 2 Proposition 3.9(iii) implies that the partition P is simply the trivial partition of V (H) into its vertex classes, whereupon (a k- partite version of) Theorem 3. implies that H contains a perfect matching. The main part of the proof is therefore the inductive step, for which we may assume that P is nontrivial by the same argument. Suppose then that H and P are as in Lemma 3.8 for some value of l, and consider the subgraphs H i for i I := I µ P (H). For each i I apply Proposition 3.5 to choose a partition of the vertex set V (H i ) of H i which is (c, µ, µ 2 )-robustly maximal with respect to H i, for some small µ µ 2. Our strategy is to randomly choose a subset T i of V (H i ) for each i I, and then to use the inductive hypothesis to find perfect matchings in each of the induced k-graphs H i := H i [T i ]. To do this we stipulate that the sets T i must partition V and that when each T i is partitioned according to the k-partition of V, the parts of T i have equal size t i εn. In addition, we need to show that for each i I: (i) At most ε n k k-partite sets A of k vertices of T i have d H i (A) < (/(l ) + γ/3)t i (for a constant ε ε). (ii) The restriction of to T i is (2c, µ /c, µ 3 2)-robustly maximal. (iii) For any vertex x T i there are at least dt k i e H i with x e and i Qi (e) L µ /c (H i). (iv) i Qi (T i ) L µ /c (H i). edges Condition (i) is a consequence of our observation above that for most k-partite sets of k vertices of H i, the proportion of possible neighbours which are actually neighbours is at least /(l ) + γ/2. With high probability this property is inherited by H i, so we obtain (i). Also, since was chosen to be (c, µ, µ 2 )-robustly maximal with respect to H i, (ii) holds with high probability by Proposition 3.6(ii).

For (iii) we notice that there may actually be a number of vertices of H i which lie in fewer than dn k edges e H i with i Qi (e) L µ (H i ). However, a short deduction from Proposition 3.9(ii) shows that the number of such bad vertices is small. Since our assumption on H was that every vertex v V lies in many edges e H with i P (e) I we may delete (before choosing the sets T i ) a small matching to remove all of the bad vertices (however, for simplicity we continue to write V for the new vertex set). We may then assume that every vertex of H i lies in at least dn k edges e H i with i Qi (e) L µ (H i ). With high probability the random selection will ensure that L µ (H i ) L µ /c (H i), and so (iii) also holds with high probability. Ensuring that (iv) is satisfied is therefore the principal difficulty in the proof of Lemma 3.8. As noted above we will have L µ (H i ) L µ /c (H i), so it is enough to ensure that i Qi (T i ) L µ (H i ). However, we must use other arguments to control i Qi (T i ); in the remainder of the section we give a sketch of these arguments. We begin by observing that (iv) depends only on the values of T i Y for parts Y. Hence if two vertices x and y are contained in the same part of for every such that x, y V (H i ), then they are effectively interchangeable for our purposes. With this in mind, we define a partition Q of V where vertices x, y V lie in the same part of Q if and only if they lie in the same part of every partition, i.e., Q is the meet of the partitions. Our strategy will be to fix the number of vertices n(i, Z) which the set T i will take from each part Z of Q so that (iv) is satisfied, and then choose the sets T i uniformly at random to satisfy these constraints. Recall that in our example in Section 3.3, problems arose in relation to a divisibility barrier partition Q which was hidden inside P. In order to discover and deal with any such partitions, we will need to consider the join Q of the partitions. We define an auxiliary graph G whose vertices are the parts of Q, where Z, Z Q are adjacent in G if they are contained in the same part of some. The parts of Q are then formed by taking the union of the parts of Q in each component of G. Choosing the numbers n(i, Z) so that (iv) is satisfied progresses through three stages: we first choose rough targets for the number of vertices to be contained in each T i ; then we choose how many vertices each T i will take from each part of Q, before finally refining this choice to obtain the numbers n(i, Z) as required. A fractional perfect matching in a k- graph H is a weighting p e of its edges such that x e p e = for each x V (H). The first stage relies on the following theorem, which is proved similarly to [3, Corollary 3.]: Theorem 3.0. Let H be a k-partite k-graph with vertex classes of size n such that every partite set of k vertices has degree at least n/k. Then H contains a fractional perfect matching. To obtain our targets for the size of each T i, we apply Theorem 3.0 to find a fractional perfect matching p e in an auxiliary k-graph on V whose edges are all k-tuples e with i P (e) I. Now set λ i = i P (e)=i p e for each i I; then i I λ ii = i P(V ) by the definition of p e. Next we adjust the λ i slightly to obtain integers ρ i with i I ρ ii = i P(V ). So we will aim for each T i to take approximately ρ i vertices from each part of V (of size n). Actually, by using the error term in the degree condition of Lemma 3.8 we can ensure further that ρ i ε n for each i I. In the second stage we choose provisional values for the quantities T i X for X Q in proportion to the integers ρ i. So if X W for some W P with i W = then our target for T i X will be ρ i X / W (and if X W with i W = 0 then our target will be 0). We then round these values to nearby integers and derive provisional values for i Q (T i ) from these integers in the natural way; that is, for each X Q our provisional vector will have our provisional value for T i X as its X-coordinate. For each i I we further adjust the provisional value for i Q (T i ) so that it lies in L µ Q (H i ). Now the provisional values will no longer sum to i Q (V ); instead they will sum to some i L µ Q (H). Crucially, the robust maximality of P now implies that Q is not transferral-free, and it is not hard to show that further i Q (V ) must lie in L µ Q (H). It follows that d = i Q (V ) i must also lie in L µ Q (H). Using this fact, we can write d = i I d i in such a way that d i L µ Q (H i ) for each i I. Further d is small (in absolute value), so we can ensure that each d i is small. Finally, we add to each provisional i Q (T i ) the vector d i and note that the property i Q (T i ) L µ Q (H) is preserved. This yields our final values for i Q (T i ). Thus we fix the quantity T i X for each X Q. In the final stage we use Baranyai s Matrix Rounding Theorem, which is stated below. Theorem 3.. [9, Theorem 7.5] Let A be a real matrix. Then there exists an integer matrix B whose entries, row sums, column sums and the sum of all the entries are the entries, row sums, column sums and the sum of all the entries respectively of A, rounded either up or down to the nearest integer. For this last stage, we deal with each part X of Q in turn. Similarly to the previous step, we take the real numbers Z T i X / X as provisional values for T i Z = n(i, Z) for each part Z Q. Let A be the matrix indexed by the parts Z X of Q whose entries are the provisional values of n(i, Z). We apply Theorem 3. to A to obtain a new matrix B and take new, integer provisional values from B. The fact that these values remain feasible is implied by Theorem 3., as the row and column sums of A are the part sizes Z and the values T i X ; since these are already integers, the row and column sums remain unchanged. From these integers we can derive provisional values for i Qi (T i ) for each i similarly as before; our goal now is to adjust these provisional values so that in addition (iv) holds. Fix i, i 2 I, and suppose that Z and Z are parts of Q which are subsets of distinct parts Y and Y respectively of, but that Z and Z are subsets of the same part Y 2 of 2. Define an (i, i 2, Z, Z )-swap as the operation of increasing the provisional values of n(i, Z) and n(i 2, Z ) each by one, and decreasing those for n(i 2, Z) and n(i, Z ) by one. An (i, i 2, Z, Z )-swap has no effect on the provisional values of i Qi2 (T i2 ); however, it adds u Y u Y to the provisional value of i Qi (T i ). We now make use of the auxiliary graph G, which was used to define Q. Apply (a k-partite version of) Lemma 3.2(i) to i Qi (T i ) to obtain parts Y and Y of such that i Qi (T i )+ u Y u Y L µ (H i ). Then Y and Y are both subsets of some part X Q. We will show that we may make a sequence of modifications to our targets for n(i, Z) whose