\geq \theta$.

[*Proof.*]{} We have $\theta\leq m-1$, $\overline \theta \leq m$ and $
 \sum_{i=1}^{\theta}e_i \leq \sum_{i=1}^{\overline \theta}a_i.$ Let $h=\min \{i \; : \; e_i<a_i\}$. Then $e_{i}=a_{i+1}$ for $h\leq i \leq m-1$.

Assume that $\theta>\overline \theta$. Then $0<\sum_{i=\overline \theta+1}^{\theta}e_i \leq \sum_{i=1}^{\overline \theta}(a_i-e_i).$ It means that there exists $i \in \{1,\dots, \overline \theta  \}$ such that $a_i-e_i>0$. Therefore, $h\leq \overline \theta <\theta <m$, from where we conclude that $e_{\overline \theta}=a_{\overline \theta+1}=0$, which is a contradiction with $\theta>\overline \theta$.

$\Box$

Main theorem {#secmain}
============

In the following Theorem we give a solution to Problem \[problem\].

\[maintheogen\] Let $A(s), B(s)\in {\mathbb F}[s]^{p\times q}$ be matrix pencils such that $A(s)\not {\ensuremath{\stackrel{s.e.}{\sim}}}B(s)$. Let $\rank A(s)=n_1$, $\rank B(s)=n_2$, let $\phi_1(s, t)\mid \dots \mid \phi_{n_1}(s, t)$, $c_1 \geq \dots \geq c_{q-n_1}\geq  0$ and $u_1 \geq \dots \geq u_{p-n_1}\geq  0$ be, respectively, the homogeneous invariant factors, column minimal indices and row minimal indices of $A(s)$ and let $\psi_1(s, t)\mid \dots \mid \psi_{n_2}(s, t)$, $d_1 \geq \dots \geq d_{q-n_2}\geq  0$ and $v_1 \geq \dots \geq v_{p-n_2}\geq  0$ be, respectively, the homogeneous invariant factors, column minimal indices and row minimal indices of $B(s)$.

Let $n=\min\{n_1, n_2\}$, ${\mathbf c}=(c_1, \dots, c_{q-n_1})$, ${\mathbf d}=(d_1, \dots, d_{q-n_2})$, ${\mathbf u}=(u_1, \dots, u_{p-n_1})$ and ${\mathbf v}=(v_1, 