I have found, unintentionally, that if you write
$\mathcal{P_1}$
you obtain the same as
$\mathcal{P}_{\infty}$
, i.e.,
Is this a bug or a Latex functionality unknown to me?
I have found, unintentionally, that if you write
$\mathcal{P_1}$
you obtain the same as
$\mathcal{P}_{\infty}$
, i.e.,
Is this a bug or a Latex functionality unknown to me?
It is not a bug or feature in LaTeX, it is user error. \mathcal should only be used with capital letters. If you use anything else you get whatever symbols happen to be in those positions in the font
See texdoc encguide. \mathcal is documented to work with only uppercase letters for classic tex math fonts. Technically it switches to the OMS encoded symbol font which has this layout:

As you will see A-Z positions have A-Z calligraphic, but all other slots have math symbols unrelated to the ASCII positions.
Just out of interest, I notice that using unicode-math changes the output here. Using xelatex or lualatex, I find that if I compile the (incorrect) OP example, I get:
as shown in the question, but if I add unicode-math, like this:
\documentclass[border=5mm]{standalone}
\usepackage{unicode-math}
\begin{document}
$\mathcal{P_1}$
\end{document}
the output is
which is the same if I correct it to $\mathcal{P}_1$.
\mathcalshould only be used with captial letters. If you use anything else you get whatever symbols happen to be in those positions in the font β David Carlisle Jan 21 '23 at 11:31