
For a prime number $p$ and a sequence of integers $a_0,\dots,a_k\in
\{0,1,\dots,p\}$, let $s(a_0,\dots,a_k)$ be the minimum number of
$(k+1)$tuples $(x_0,\dots,x_k)\in A_0\times\dots\times A_k$ with
$x_0=x_1+\dots + x_k$, over subsets $A_0,\dots,A_k\subseteq\mathbb{Z}_p$ of
sizes $a_0,\dots,a_k$ respectively. An elegant argument of Lev (independently
rediscovered by Samotij and Sudakov) shows that there exists an extremal
configuration with all sets $A_i$ being intervals of appropriate length, and
that the same conclusion also holds for the related problem, reposed by Bajnok,
when $a_0=\dots=a_k=:a$ and $A_0=\dots=A_k$, provided $k$ is not equal 1 modulo
$p$. By applying basic Fourier analysis, we show for Bajnok's problem that if
$p\ge 13$ and $a\in\{3,\dots,p3\}$ are fixed while $k\equiv 1\pmod p$ tends to
infinity, then the extremal configuration alternates between at least two
affine nonequivalent sets.

Many important problems in combinatorics and other related areas can be
phrased in the language of independent sets in hypergraphs. Recently Balogh,
Morris and Samotij, and independently Saxton and Thomason developed very
general container theorems for independent sets in hypergraphs; both of which
have seen numerous applications to a wide range of problems. In this paper we
use the container method to give relatively short and elementary proofs of a
number of results concerning Ramsey (and Tur\'an) properties of (hyper)graphs
and the integers. In particular:
(i) We generalise the random Ramsey theorem of R\"odl and Ruci\'nski by
providing a resilience analogue. Our result unifies and generalises several
fundamental results in the area including the random version of Tur\'an's
theorem due to Conlon and Gowers and Schacht.
(ii) The above result also resolves a general subcase of the asymmetric
random Ramsey conjecture of Kohayakawa and Kreuter.
(iii) All of the above results in fact hold for uniform hypergraphs.
(iv) For a (hyper)graph $H$, we determine, up to an error term in the
exponent, the number of $n$vertex (hyper)graphs $G$ that have the Ramsey
property with respect to $H$ (that is, whenever $G$ is $r$coloured, there is a
monochromatic copy of $H$ in $G$).
(v) We strengthen the random Rado theorem of Friedgut, R\"odl and Schacht by
proving a resilience version of the result.
(vi) For partition regular matrices $A$ we determine, up to an error term in
the exponent, the number of subsets of $\{1,\dots,n\}$ for which there exists
an $r$colouring which contains no monochromatic solutions to $Ax=0$.
Along the way a number of open problems are posed.

Let $f(n,r)$ denote the maximum number of colourings of $A \subseteq \lbrace
1,\ldots,n\rbrace$ with $r$ colours such that each colour class is sumfree.
Here, a sum is a subset $\lbrace x,y,z\rbrace$ such that $x+y=z$. We show that
$f(n,2) = 2^{\lceil n/2\rceil}$, and describe the extremal subsets. Further,
using linear optimisation, we asymptotically determine the logarithm of
$f(n,r)$ for $r \leq 5$. Similar results were obtained by H\`an and Jim\'enez
in the setting of finite abelian groups.

Koml\'os conjectured in 1981 that among all graphs with minimum degree at
least $d$, the complete graph $K_{d+1}$ minimises the number of Hamiltonian
subsets, where a subset of vertices is Hamiltonian if it contains a spanning
cycle. We prove this conjecture when $d$ is sufficiently large. In fact we
prove a stronger result: for large $d$, any graph $G$ with average degree at
least $d$ contains almost twice as many Hamiltonian subsets as $K_{d+1}$,
unless $G$ is isomorphic to $K_{d+1}$ or a certain other graph which we
specify.

Given a graph $F$, let $s_t(F)$ be the number of subdivisions of $F$, each
with a different vertex set, which one can guarantee in a graph $G$ in which
every edge lies in at least $t$ copies of $F$. In 1990, Tuza asked for which
graphs $F$ and large $t$, one has that $s_t(F)$ is exponential in a power of
$t$. We show that, somewhat surprisingly, the only such $F$ are complete
graphs, and for every $F$ which is not complete, $s_t(F)$ is polynomial in $t$.
Further, for a natural strengthening of the local condition above, we also
characterise those $F$ for which $s_t(F)$ is exponential in a power of $t$.

Let $\mathbf{k} := (k_1,\dots,k_s)$ be a sequence of natural numbers. For a
graph $G$, let $F(G;\mathbf{k})$ denote the number of colourings of the edges
of $G$ with colours $1,\dots,s$ such that, for every $c \in \{1,\dots,s\}$, the
edges of colour $c$ contain no clique of order $k_c$. Write $F(n;\mathbf{k})$
to denote the maximum of $F(G;\mathbf{k})$ over all graphs $G$ on $n$ vertices.
This problem was first considered by Erd\H{o}s and Rothschild in 1974, but it
has been solved only for a very small number of nontrivial cases.
We prove that, for every $\mathbf{k}$ and $n$, there is a complete
multipartite graph $G$ on $n$ vertices with $F(G;\mathbf{k}) =
F(n;\mathbf{k})$. Also, for every $\mathbf{k}$ we construct a finite
optimisation problem whose maximum is equal to the limit of $\log_2
F(n;\mathbf{k})/{n\choose 2}$ as $n$ tends to infinity. Our final result is a
stability theorem for complete multipartite graphs $G$, describing the
asymptotic structure of such $G$ with $F(G;\mathbf{k}) = F(n;\mathbf{k}) \cdot
2^{o(n^2)}$ in terms of solutions to the optimisation problem.

A famous conjecture of P\'osa from 1962 asserts that every graph on $n$
vertices and with minimum degree at least $2n/3$ contains the square of a
Hamilton cycle. The conjecture was proven for large graphs in 1996 by Koml\'os,
S\'ark\"ozy and Szemer\'edi. In this paper we prove a degree sequence version
of P\'osa's conjecture: Given any $\eta >0$, every graph $G$ of sufficiently
large order $n$ contains the square of a Hamilton cycle if its degree sequence
$d_1\leq \dots \leq d_n$ satisfies $d_i \geq (1/3+\eta)n+i$ for all $i \leq
n/3$. The degree sequence condition here is asymptotically best possible. Our
approach uses a hybrid of the RegularityBlowup method and the
ConnectingAbsorbing method.

We prove that, for large $n$, every $3$connected $D$regular graph on $n$
vertices with $D \geq n/4$ is Hamiltonian. This is best possible and confirms a
conjecture posed independently by Bollob\'as and H\"aggkvist in the 1970s. The
proof builds on a structural decomposition result proved recently by the same
authors.

In this paper, we study the largescale structure of dense regular graphs.
This involves the notion of robust expansion, a recent concept which has
already been used successfully to settle several longstanding problems. Roughly
speaking, a graph is robustly expanding if it still expands after the deletion
of a small fraction of its vertices and edges. Our main result allows us to
harness the useful consequences of robust expansion even if the graph itself is
not a robust expander. It states that every dense regular graph can be
partitioned into `robust components', each of which is a robust expander or a
bipartite robust expander. We apply our result to obtain (amongst others) the
following. (i) We prove that whenever $\eps >0$, every sufficiently large
3connected Dregular graph on n vertices with $D \geq (1/4 + \eps)n$ is
Hamiltonian. This asymptotically confirms the only remaining case of a
conjecture raised independently by Bollob\'as and H\"aggkvist in the 1970s.
(ii) We prove an asymptotically best possible result on the circumference of
dense regular graphs of given connectivity. The 2connected case of this was
conjectured by Bondy and proved by Wei.

We show that every sufficiently large rregular digraph G which has linear
degree and is a robust outexpander has an approximate decomposition into
edgedisjoint Hamilton cycles, i.e. G contains a set of ro(r) edgedisjoint
Hamilton cycles. Here G is a robust outexpander if for every set S which is not
too small and not too large, the `robust' outneighbourhood of S is a little
larger than S. This generalises a result of K\"uhn, Osthus and Treglown on
approximate Hamilton decompositions of dense regular oriented graphs. It also
generalises a result of Frieze and Krivelevich on approximate Hamilton
decompositions of quasirandom (di)graphs. In turn, our result is used as a tool
by K\"uhn and Osthus to prove that any sufficiently large rregular digraph G
which has linear degree and is a robust outexpander even has a Hamilton
decomposition.