My final-year project at the National University of Singapore is on Zarankiewicz's problem:
What is the maximum number of 1s in an ×ばつn\$ binary matrix (\$m\$ rows and \$n\$ columns) with no \$a×ばつb\$ minor (intersection of any \$a\$ rows and any \$b\$ columns) being all 1s?
For example, the matrix below contains a ×ばつ3\$ all-1 minor
$$\begin{bmatrix}
0&(1)&1&(1)&(1)&1\\
1&1&0&1&0&0\\
0&(1)&0&(1)&(1)&0\\
0&1&1&0&1&1\\
1&1&0&0&0&1\\
1&(1)&0&(1)&(1)&0
\end{bmatrix}$$
but this matrix contains no such minor – the intersection of any 3 rows and 3 columns always has at least one 0:
$$\begin{bmatrix}
0&1&1&1&1&1\\
1&0&0&1&1&1\\
1&0&1&0&1&1\\
1&1&0&1&0&1\\
1&1&1&0&0&1\\
1&1&1&1&1&0
\end{bmatrix}$$
Now any matrix with the maximum number of 1s is also maximal in the sense that adding another 1 anywhere in the matrix will create an \$a×ばつb\$ minor. This task concerns itself with checking maximal matrices, not necessarily with the maximum number of 1s.
Task
Given a non-empty binary matrix \$M\$ of size ×ばつn\$ and two positive integers \$a\$ and \$b\$ where \$a\le m\$ and \$b\le n\$, determine whether \$M\$ has no \$a×ばつb\$ all-1 minor, but has at least one such minor if any 0 in \$M\$ is changed to a 1. Output "true" or "false"; any two distinct values may be used for them. Formatting is also flexible for \$M\$.
This is code-golf; fewest bytes wins.
Test inputs
These are given in the form M a b.
"True" output:
[[0]] 1 1
[[0,1,1],[1,0,1],[1,1,0]] 2 2
[[0,1,0],[1,1,1],[0,1,0]] 2 2
[[1,1,0,1,0],[1,0,1,1,1],[0,1,1,0,1]] 2 3
[[1,1,1,1,1],[1,1,1,1,1],[1,0,0,0,0]] 3 2
[[0,1,1,1,1,1,1,1],[1,1,1,1,1,0,0,0],[1,1,1,0,0,1,1,0],[1,1,0,1,0,1,0,1],[1,1,0,0,1,0,1,1],[1,0,1,1,0,0,1,1],[1,0,1,0,1,1,0,1],[1,0,0,1,1,1,1,0]] 3 3
[[1,1,1,1,1,1,1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