• We show that for every sufficiently large $n$, the number of monotone subsequences of length four in a permutation on $n$ points is at least $\binom{\lfloor n/3 \rfloor}{4} + \binom{\lfloor(n+1)/3\rfloor}{4} + \binom{\lfloor (n+2)/3\rfloor}{4}$. Furthermore, we characterize all permutations on $[n]$ that attain this lower bound. The proof uses the flag algebra framework together with some additional stability arguments. This problem is equivalent to some specific type of edge colorings of complete graphs with two colors, where the number of monochromatic $K_4$'s is minimized. We show that all the extremal colorings must contain monochromatic $K_4$'s only in one of the two colors. This translates back to permutations, where all the monotone subsequences of length four are all either increasing, or decreasing only.
  • A lattice L is slim if it is finite and the set of its join-irreducible elements contains no three-element antichain. Slim, semimodular lattices were previously characterized by G. Cz\'edli and E.T. Schmidt as the duals of the lattices consisting of the intersections of the members of two composition series in a group. Our main result determines the number of (isomorphism classes of) these lattices of a given size in a recursive way. The corresponding planar diagrams, up to similarity, are also enumerated. We prove that the number of diagrams of slim, distributive lattices of a given length b is the n-th Catalan number. Besides lattice theory, the paper includes some combinatorial arguments on permutations and their inversions.