Given a d-dimensional tensor T: A(1) x ... x A(d) -> F (where F is a field), the i-flattening rank of T is the rank of the matrix whose rows are indexed by A(i), columns are indexed by B-i = A(1) x ... x A(i-1) x A(i+1) x ... x A(d) and whose entries are given by the corresponding values of T. The max-flattening rank of T is defined as mfrank(T) = max(i is an element of[d]) frank(i)(T). A tensor T : A(d) -> F is called semi-diagonal, if T(a,...,a) not equal 0 for every a is an element of A, and T(a(1),...,a(d)) = 0 for every a(1),...,a(d) is an element of A that are all distinct. In this paper we prove that if T : A(d) -> F is semi-diagonal, then mfrank(T) >= vertical bar A vertical bar/d-1, and this bound is the best possible. We give several applications of this result, including a generalization of the celebrated Frankl-Wilson theorem on forbidden intersections. Also, addressing a conjecture of Aharoni and Berger, we show that if the edges of an r-uniform multi-hypergraph H are colored with z colors such that each color class is a matching of size t, then H contains a rainbow matching of size t provided z > (t - 1)(rt r). This improves previous results of Alon and Glebov, Sudakov, and Szabo. (C) 2021 Elsevier Inc. All rights reserved.