\qed
\para
-The bad news is that computing the permanent is known to be~$\#P$-complete even
+The bad news is that computing the permanent is known to be~$\#\rm P$-complete even
for zero-one matrices (as proven by Valiant \cite{valiant:permanent}).
As a~ranking function for a~set of~matchings can be used to count all such
matchings, we obtain the following theorem:
\thm\id{pcomplete}%
If there is a~polynomial-time algorithm for lexicographic ranking of permutations with
-a~set of restrictions which is a~part of the input, then $P=\#P$.
+a~set of restrictions which is a~part of the input, then $\rm P=\#P$.
\proof
We will show that a~polynomial-time ranking algorithm would imply a~po\-ly\-nom\-ial-time
algorithm for computing the permanent of an~arbitrary zero-one matrix, which
-is a~$\#P$-complete problem.
+is a~$\#\rm P$-complete problem.
We know from Lemma \ref{permchar} that non-zero
summands in the permanent of a~zero-one matrix~$M$ correspond to permutations restricted