Let $E \to F$ be a map of vector bundles on a scheme $X$ of ranks $e, f$ (actually, I hope $X$ may be a stack here). Suppose $e \leq f$. I want to describe the locus $D \subseteq X$ where $E \to F$ drops rank, i.e., when its rank is at most $e-1$. (I really want the class $[O_D]$ in the $K$ theory of $X$.)
Eisenbud's commutative algebra book in A2.6 gives an answer, but he supposes $e \geq f$ at the beginning of the section, interpreting this as a resolution of the cokernel of $E \to F$. I want to know when $E \to F$ has nontrivial kernel.
Anders Buch gives a Thom-Porteous formula for the degeneracy locus which we thought we could use. But on a stack, the formula doesn't make sense due to infinite sums. So we are eager to find any way of calculating or resolving $[O_D]$ in $K$ theory.