A detachment of a hypergraph is formed by splitting each vertex into one or more subvertices, and sharing the incident edges arbitrarily among the subvertices. For a given edge-coloured hypergraph  , we prove that there exists a detachment
, we prove that there exists a detachment  such that the degree of each vertex and the multiplicity of each edge in
 such that the degree of each vertex and the multiplicity of each edge in  (and each colour class of
 (and each colour class of  ) are shared fairly among the subvertices in
) are shared fairly among the subvertices in  (and each colour class of
 (and each colour class of  , respectively).
, respectively).
Let  be a hypergraph with vertex partition {V1,. . .,Vn}, |Vi| = pi for 1 ≤ i ≤ n such that there are λi edges of size hi incident with every hi vertices, at most one vertex from each part for 1 ≤ i ≤ m (so no edge is incident with more than one vertex of a part). We use our detachment theorem to show that the obvious necessary conditions for
 be a hypergraph with vertex partition {V1,. . .,Vn}, |Vi| = pi for 1 ≤ i ≤ n such that there are λi edges of size hi incident with every hi vertices, at most one vertex from each part for 1 ≤ i ≤ m (so no edge is incident with more than one vertex of a part). We use our detachment theorem to show that the obvious necessary conditions for  to be expressed as the union
 to be expressed as the union  1 ∪ ··· ∪
1 ∪ ··· ∪  k of k edge-disjoint factors, where for 1 ≤ i ≤ k,
k of k edge-disjoint factors, where for 1 ≤ i ≤ k,  i is ri-regular, are also sufficient. Baranyai solved the case of h1 = ··· = hm, λ1 = ··· = λm = 1, p1 = ··· = pm, r1 = ··· = rk. Berge and Johnson (and later Brouwer and Tijdeman, respectively) considered (and solved, respectively) the case of hi = i, 1 ≤ i ≤ m, p1 = ··· = pm = λ1 = ··· = λm = r1 = ··· = rk = 1. We also extend our result to the case where each
i is ri-regular, are also sufficient. Baranyai solved the case of h1 = ··· = hm, λ1 = ··· = λm = 1, p1 = ··· = pm, r1 = ··· = rk. Berge and Johnson (and later Brouwer and Tijdeman, respectively) considered (and solved, respectively) the case of hi = i, 1 ≤ i ≤ m, p1 = ··· = pm = λ1 = ··· = λm = r1 = ··· = rk = 1. We also extend our result to the case where each  i is almost regular.
i is almost regular.