%% The class cedram-ALCO is just a wrapper around amsart.cls (version 2)
%% implementing the layout of the journal, and some additionnal
%% administrative commands. 
%% You can place one option:
%% * "Unicode" if the file is UTF-8 encoded.
\documentclass[ALCO,Unicode,published]{cedram}
%% Here you might want to add some standard packages if those
%% functionnalities are required.
%\usepackage[matrix,arrow,tips,curve]{xy}
\usepackage{mathrsfs}
\usepackage{tikz}
\usepackage{ytableau}
% ...
%% The production will anyway use amsmath (all ams utilities except
%% amscd for commutative diagrams which you need to load explicilty if
%% required), hyperref, graphicx, mathtools, enumitem...

%% User definitions if necessary...  Such definitions are forbidden
%% inside titles, abstracts or the bibliography.
\DeclarePairedDelimiter\abs{\lvert}{\rvert} %Something useful only for this sample's sake: you can erase this line in your file (or find it useful...)
\newcommand{\sD}{\mathscr{D}}
\newcommand{\sP}{\mathscr{P}}
%% The title of the paper: amsart's syntax. 
\title
%% The optionnal argument is the short version for headings.
[On the $k$-measure of partitions and distinct partitions]
%% The mandatory argument is for the title page, summaries, headings
%% if optionnal void.
{On the $k$-measure of partitions and distinct partitions}

%% Authors according to amsart's syntax + distinction between Given
%% and Proper names:
\author[\initial{G.} \middlename{E.} Andrews]{\firstname{George} \middlename{E.} \lastname{Andrews}}

%% Do not include any other information inside \author's argument!
%% Other author data have special commands for them:
\address{Penn State University\\ 
Department of Mathematics\\
University Park\\
PA 16802 (USA)}

%% Current address, if different from institutionnal address
%\curraddr{Coll\`ege Royal Henri-Le-Grand\\
%Prytan\'ee National Militaire\\
%72000 La Fl\`eche, Sarthe (France)}

%% e-mail address
\email{gea1@psu.edu}

%% possibly home page URL (not encouraged by journal's style)
%\urladdr{https://en.wikipedia.org/wiki/Marin\_Mersenne}

%% Acknowledgements are not a footnote in
%% \author, but are given apart:
%\thanks{The author was partially supported by a special grant for Junior Woodchucks.}
\thanks{The first author was supported by a grant (\#633284) from the Simons Foundation. The second author was supported by a Killam Postdoctoral Fellowship from the Killam Trusts.}

%% If co-authors exist, add them the same way, in alaphabetical order
\author[\initial{S.} Chern]{\firstname{Shane} \lastname{Chern}}
\address{Dalhousie University\\ 
	Department of Mathematics and Statistics\\
	Halifax\\
	Nova Scotia, B3H 4R2 (Canada)}
\email{chenxiaohang92@gmail.com}

\author[\initial{Z.} Li]{\firstname{Zhitai} \lastname{Li}}
\address{Penn State University\\ 
	Department of Mathematics\\
	University Park\\
	PA 16802 (USA)}
\email{zfl5082@psu.edu}

% Key words and phrases:
\keywords{partition, distinct partition, generating function, $k$-measure, Durfee square}
  

%% Mathematical classification (2010)
%% This will not be printed but can be useful for database search
\subjclass{11P84, 05A17}

\dedicatory{Dedicated to Ian Goulden and David Jackson}

%\datereceived{2021-05-05}
%\daterevised{2022-06-14}
%\dateaccepted{2022-06-28}
\datepublished{2022-12-19}
\begin{document}
%% Abstracts must be placed before \maketitle
\begin{abstract}
  The $k$-measure of an integer partition was recently introduced by Andrews, Bhattacharjee and Dastidar. In this paper, we establish trivariate generating function identities counting both the length and the $k$-measure for partitions and distinct partitions, respectively. The $2$-measure case for partitions extends a result of Andrews, Bhattacharjee and Dastidar.
\end{abstract}


\maketitle

\section{Introduction}

The study of sequences in partitions has its origin in Sylvester's seminal paper \cite[Item (16), p.~265]{Syl1882}. His result can be translated into the modern language of integer partitions as follows.

\begin{theo}[Sylvester]
	The number of partitions of $n$ into odd parts with exactly $k$ distinct parts equals the number of partitions of $n$ into distinct parts such that exactly $k$ sequences of consecutive integers occur in each partition.
\end{theo}

Along this road, we also witness the pioneering work of MacMahon \cite[Section VII, Chapter IV, pp.~49--58]{Mac1984}, Hirschhorn \cite[Chapter 5, pp.~51--56]{Hir1979} and many others. Briefly speaking, in these work, the main objects are sequences or certain subsequences of parts in partitions in which some sort of difference conditions are satisfied. From this perspective, Andrews, Bhattacharjee and Dastidar \cite{ABD2021} recently introduced a family of new statistics for partitions, which they called $k$-measure.

\begin{defi}
	The \textit{$k$-measure} of a partition is the length of the largest subsequence (not necessarily consecutive) of parts in a partition in which the difference between any two consecutive parts of the subsequence is at least $k$.
\end{defi}

\begin{exam}
	Given a partition $\lambda=11+8+8+7+4+2+2+1$, its $k$-measure for small $k$ and the corresponding maximal subsequences are summarized as follows:
	
	\begin{align*}
		\begin{array}{cp{0.5cm}cp{0.5cm}l}
			\hline
			k && \mu_k(\lambda) && \multicolumn{1}{c}{\text{maximal subsequence(s)}}\\
			\hline
			1 && 6 && \text{$(11,8,7,4,2,1)$}\\
			2 && 4 && \text{$(11,8,4,2)$, $(11,8,4,1)$, $(11,7,4,2)$, etc.}\\
			3 && 4 && \text{$(11,8,4,1)$, $(11,7,4,1)$}\\
			4 && 3 && \text{$(11,7,2)$, $(11,7,1)$}\\
			5 && 2 && \text{$(11,4)$, $(11,2)$, $(11,1)$, $(8,2)$, etc.}\\
			\hline
		\end{array}
	\end{align*}
\end{exam}

As remarked in \cite{ABD2021}, the $1$-measure of a partition is the number of distinct parts in this partition. The objective of \cite{ABD2021} is to build a surprising connection between the $2$-measure and the Durfee square of partitions. Here the \textit{Durfee square} of a partition is the largest square that fits inside the Ferrers diagram of this partition.

\begin{theo}[Andrews et al.]\label{th:ABD}
	The number of partitions of $n$ with $2$-measure $m$ equals the number of partitions of $n$ with Durfee square of length $m$.
\end{theo}

Throughout, let $\sP$ and $\sD$ denote the set of partitions and the set of partitions into distinct parts, respectively.

Given any partition $\lambda$, we denote by $|\lambda|$ the \textit{size}, that is, the sum of all parts of $\lambda$, by $\ell(\lambda)$ the \textit{length}, that is, the number of parts of $\lambda$, and by $\mu_k(n)$ the $k$-measure of $\lambda$ for positive integers $k$.

Let the \textit{$q$-Pochhammer symbol} be defined for $n\in \mathbb{N}\cup\{\infty\}$:
$$(A;q)_n:=\prod_{k=0}^{n-1}(1-Aq^k).$$

Our first objective is to establish trivariate generating function identities enumerating both the length and the $k$-measure of partitions.

\begin{theo}\label{th:P-main}
	For $k\ge 1$,
	\begin{equation}\label{eq:P-main}
		\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} = \frac{1}{(yq;q)_\infty}\sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2} (z;q^{k-1})_n}{(q;q)_n}.
	\end{equation}
	Also, assuming that $|z|<1$,
	\begin{equation}\label{eq:P-main-2}
		\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} = (z;q^{k-1})_\infty \sum_{n\ge 0}\frac{z^n}{(q^{k-1};q^{k-1})_n (yq;q)_{(k-1)n}}.
	\end{equation}
\end{theo}

From a combinatorial perspective, the $2$-measure case of the above result yields an extension of Theorem \ref{th:ABD}.

\begin{coro}\label{coro:P}
	The number of partitions of $n$ with $\ell$ parts and $2$-measure equal to $m$ is the same as the number of partitions of $n$ with $\ell$ parts and Durfee square of length $m$.
\end{coro}

\begin{exam}
	Considering partitions of $9$ with three parts, we summarize their $2$-measure and Durfee square length as follows. Among the seven partitions, one partition has $2$-measure/Durfee square length $1$, five partitions have $2$-measure/Durfee square length $2$, and one partition has $2$-measure/Durfee square length $3$.
	
	\begin{align*}
		\begin{array}{cp{0.5cm}cp{0.5cm}c}
			\hline
			\text{partition} && \text{$2$-measure} && \text{Durfee square length}\\
			\hline
			7+1+1 && 2 && 1\\
			6+2+1 && 2 && 2\\
			5+3+1 && 3 && 2\\
			5+2+2 && 2 && 2\\
			4+4+1 && 2 && 2\\
			4+3+2 && 2 && 2\\
			3+3+3 && 1 && 3\\
			\hline
		\end{array}
	\end{align*}
\end{exam}

We also have a corollary that builds a connection with partitions into distinct odd parts.

\begin{coro}\label{coro:P2}
	The excess of the number of partitions $\lambda$ of $n$ with $\ell(\lambda)+\mu_2(\lambda)$ even over those with $\ell(\lambda)+\mu_2(\lambda)$ odd equals the number of partitions of $n$ into distinct odd parts.
\end{coro}

\begin{exam}
	Considering partitions of $5$, we summarize their $2$-measure and length as follows. Among the seven partitions, 4 partitions are such that $\ell(\lambda)+\mu_2(\lambda)$ is even and 3 partitions are such that $\ell(\lambda)+\mu_2(\lambda)$ is odd. Also, there is $1=4-3$ partition of $5$ into distinct odd parts.
	
	\begin{align*}
		\begin{array}{cp{0.5cm}cp{0.5cm}cp{0.5cm}c}
			\hline
			\lambda && \mu_2(\lambda) && \ell(\lambda) && \ell(\lambda)+\mu_2(\lambda)\\
			\hline
			5 && 1 && 1 && 2\\
			4+1 && 2 && 2 && 4\\
			3+2 && 1 && 2 && 3\\
			3+1+1 && 2 && 3 && 5\\
			2+2+1 && 1 && 3 && 4\\
			2+1+1+1 && 1 && 4 && 5\\
			1+1+1+1+1 && 1 && 5 && 6\\
			\hline
		\end{array}
	\end{align*}
\end{exam}

Our next objective is to investigate an analog for partitions into distinct parts.

\begin{theorem}\label{th:D-main}
	For $k\ge 1$,
	\begin{equation}\label{eq:D-main}
		\sum_{\lambda\in\sD} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} = (-yq;q)_\infty \sum_{n\ge 0}\frac{(-1)^n y^n q^n (z;q^k)_n}{(q;q)_n}.
	\end{equation}
	Also, assuming that $|z|<1$,
	\begin{equation}\label{eq:D-main-2}
		\sum_{\lambda\in\sD} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} = (z;q^k)_\infty \sum_{n\ge 0}\frac{(-yq;q)_{kn} z^n}{(q^{k};q^{k})_n}.
	\end{equation}
\end{theorem}

Theorems \ref{th:P-main} and \ref{th:D-main} immediately reveal two unexpected nonnegativity results.

\begin{coro}\label{coro:nonnegative}
	Let $k\ge 1$. In the series expansions of
	$$\frac{1}{(yq;q)_\infty}\sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2} (z;q^k)_n}{(q;q)_n}$$
	and
	$$(-yq;q)_\infty \sum_{n\ge 0}\frac{(-1)^n y^n q^n (z;q^k)_n}{(q;q)_n},$$
	the coefficient of $y^\ell z^m q^n$ is always nonnegative.
\end{coro}

\section{$q$-Difference equations}

Throughout, we define for $k\ge 1$,
\begin{align*}
	F_k(y)=F_k(y,z,q)&:=\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|},\\
	G_k(y)=G_k(y,z,q)&:=\sum_{\lambda\in\sD} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|}.
\end{align*}
Our task in this section is to construct $q$-difference equations for $F_k(y)$ and $G_k(y)$.

Let $\sigma(\lambda)$ be the smallest part of a partition $\lambda$. We start with a trivial observation. If we add a positive integer $j$ to each part of $\lambda$, then the resulting partition $\lambda^*$ has $\ell(\lambda^*)=\ell(\lambda)$, $\mu_k(\lambda^*)=\mu_k(\lambda)$ and $\sigma(\lambda^*)\ge j+1$. Therefore,
\begin{align*}
	\sum_{\substack{\lambda\in\sP\\\sigma(\lambda)\ge j}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} &= F_k(yq^{j-1}),\\
	\sum_{\substack{\lambda\in\sD\\\sigma(\lambda)\ge j}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|} &= G_k(yq^{j-1}).
\end{align*}
Thus,
\begin{align}
	F_k(y)-F_k(yq) &= \sum_{\substack{\lambda\in\sP\\\sigma(\lambda)= 1}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|},\label{eq:F1}\\
	G_k(y)-G_k(yq) &= \sum_{\substack{\lambda\in\sD\\\sigma(\lambda)= 1}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|}.\label{eq:G1}
\end{align}

On the other hand, given a partition $\lambda$ with $\sigma(\lambda)=1$, we delete all parts of size $1,2,\ldots,k$ and call the resulting partition $\lambda'$. Then, $\sigma(\lambda')\ge k+1$. We also claim that $\mu_k(\lambda)=\mu_k(\lambda')+1$. To see this, we assume that $\mu_k(\lambda')=m$, which means that there exists an $m$-member subsequence $S$ of parts in $\lambda'$ such that the difference between any two consecutive parts of this subsequence is at least $k$. Also, no such $(m+1)$-member subsequence exists. Note that all parts in $S$ are at least $k+1$. Since $1$ is a part in $\lambda$, then $S\cup\{1\}$ gives an $(m+1)$-member subsequence of parts in $\lambda$ so that the requirement of $k$-measure is satisfied. Thus, $\mu_k(\lambda)\ge m+1 = \mu_k(\lambda')+1$. To show $\mu_k(\lambda)\le m+1$, we simply assume that these is an $(m+2)$-member subsequence of parts in $\lambda$ with the requirement of $k$-measure satisfied. Since $1,2,\ldots,k$ cannot be simultaneously in this subsequence, then we arrive at a subsequence of length at least $m+1$ of parts in $\lambda'$ wherein the requirement of $k$-measure is satisfied. This results in a contradiction. Therefore, we are led to the desired claim $\mu_k(\lambda)=\mu_k(\lambda')+1$. Thus,
\begin{align}\label{eq:F2}
	\sum_{\substack{\lambda\in\sP\\\sigma(\lambda)= 1}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|}&=\frac{yzq}{(1-yq)(1-yq^2)\cdots (1-yq^k)}\sum_{\substack{\lambda\in\sP\\\sigma(\lambda)\ge k+1}} y^{\ell(\lambda)} z^{\mu_k(\lambda)} q^{|\lambda|}\\
	&=\frac{yzq}{(yq;q)_k}F_k(yq^k)\notag
\end{align}
and
\begin{align}\label{eq:G2}
	\sum_{\substack{\lambda\in\sD\\\sigma(\lambda)= 1}} y^{\ell(\lambda)} z^{\mu_2(\lambda)} q^{|\lambda|}&=yzq(1+yq^2)(1+yq^3)\cdots (1+yq^k)\sum_{\substack{\lambda\in\sD\\\sigma(\lambda)\ge k+1}} y^{\ell(\lambda)} z^{\mu_2(\lambda)} q^{|\lambda|}\\
	&=yzq(-yq^2;q)_{k-1}G_k(yq^k).\notag
\end{align}

In light of \eqref{eq:F1}--\eqref{eq:G2}, we have the following $q$-difference equations.

\begin{lemm}
	For $k\ge 1$,
	\begin{equation}\label{eq:F-dif}
		F_k(y) - F_k(yq) = \frac{yzq}{(yq;q)_k}F_k(yq^k)
	\end{equation}
	and
	\begin{equation}\label{eq:G-dif}
		G_k(y) - G_k(yq) = yzq(-yq^2;q)_{k-1}G_k(yq^k).
	\end{equation}
\end{lemm}

\section{Proofs of Theorem \ref{th:P-main} and Corollaries \ref{coro:P} and \ref{coro:P2}}

We first prove Theorem \ref{th:P-main}.

\begin{proof}[Proof of Theorem \ref{th:P-main}]
	We first multiply by $(yq;q)_\infty$ on both sides of \eqref{eq:F-dif}. Then,
	$$(yq;q)_\infty F_k(y) - (1-yq)(yq^2;q)_\infty F_k(yq) = yzq(yq^{k+1};q)_\infty F_k(yq^k).$$
	Let us define
	$$S_k(y):=(yq;q)_\infty F_k(y).$$
	Thus,
	\begin{align}
		S_k(y)-(1-yq)S_k(yq)=yzqS_k(yq^k).
	\end{align}
	We further write
	$$S_k(y):=\sum_{n\ge 0}s_k(n) y^n.$$
	Then $s_k(0)=S_k(0)=F_k(0)=1$. Further, for $n\ge 1$, we deduce from the above $q$-difference equation for $S_k(y)$ that
	$$s_k(n)-\big(s_k(n)q^n-qs_k(n-1)q^{n-1}\big) = zqs_k(n-1)q^{k(n-1)}.$$
	Therefore,
	$$\frac{s_k(n)}{s_k(n-1)}= \frac{-q^n(1-zq^{(k-1)(n-1)})}{1-q^n}.$$
	We then have
	$$s_k(n)=\frac{(-1)^n q^{n(n+1)/2} (z;q^{k-1})_n}{(q;q)_n},$$
	and therefore,
	$$S_k(y)=\sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2} (z;q^{k-1})_n}{(q;q)_n}.$$
	Since $F_k(y)= S_k(y)/(yq;q)_\infty$, the first part of the theorem follows.
	
	For the second part of this theorem, we recall Euler's first and second identities \cite[Corollary 2.2, p.~19]{And1976}:
	\begin{gather}
		\frac{1}{(t;q)_\infty}=\sum_{m\ge 0} \frac{t^m}{(q;q)_m}\label{eq:Eul1}\\
		\intertext{and}
		(t;q)_\infty=\sum_{m\ge 0} \frac{(-t)^m q^{m(m-1)/2}}{(q;q)_m}.\label{eq:Eul2}
	\end{gather}
	Thus,
	\begin{align*}
		F_k(y)&=\frac{1}{(yq;q)_\infty}\sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2} (z;q^{k-1})_n}{(q;q)_n}\\
		&=\frac{(z;q^{k-1})_\infty}{(yq;q)_\infty} \sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2}}{(q;q)_n}\frac{1}{(zq^{(k-1)n};q^{k-1})_\infty}\\
		\text{\tiny (by \eqref{eq:Eul1})}&=\frac{(z;q^{k-1})_\infty}{(yq;q)_\infty} \sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2}}{(q;q)_n}\sum_{m\ge 0}\frac{z^m q^{(k-1)mn}}{(q^{k-1};q^{k-1})_m}\\
		&=\frac{(z;q^{k-1})_\infty}{(yq;q)_\infty} \sum_{m\ge 0} \frac{z^m}{(q^{k-1};q^{k-1})_m} \sum_{n\ge 0}\frac{(-1)^n y^n q^{n(n+1)/2+(k-1)mn}}{(q;q)_n}\\
		\text{\tiny (by \eqref{eq:Eul2})}&=\frac{(z;q^{k-1})_\infty}{(yq;q)_\infty} \sum_{m\ge 0} \frac{z^m}{(q^{k-1};q^{k-1})_m} (yq^{(k-1)m+1};q)_\infty\\
		&=(z;q^{k-1})_\infty \sum_{m\ge 0} \frac{z^m}{(q^{k-1};q^{k-1})_m (yq;q)_{(k-1)m}}.
	\end{align*}
	This proves \eqref{eq:P-main-2}.
\end{proof}

\begin{rema*}
	Our proof of \eqref{eq:P-main-2} from \eqref{eq:P-main} is based on the so-called ``Heine's method.'' In fact, such a deduction is an instance of the generalized Heine transformation:
	\begin{equation}\label{eq:gen-Heine}
		\sum_{n\ge 0}\frac{(a;q^h)_n(b;q)_{hn} t^n}{(q^h;q^h)_n(c;q)_{hn}} = \frac{(b;q)_\infty (at;q^h)_\infty}{(c;q)_\infty (t;q^h)_\infty} \sum_{n\ge 0} \frac{(c/b;q)_n(t;q^h)_{n} b^n}{(q;q)_n(at;q^h)_{n}},
	\end{equation}
	which first appeared in \cite[Lemma 1, p.~577]{And1966}. Setting $h=k-1$, $t\mapsto z$, $c\mapsto yq$ and letting $a,b\to 0$ in the above, we will see the equivalence between \eqref{eq:P-main} and \eqref{eq:P-main-2}.
\end{rema*}

Corollary \ref{coro:P} is an immediate consequence of Theorem \ref{th:P-main}.

\begin{proof}[Proof of Corollary \ref{coro:P}]
	Letting $k=2$ in \eqref{eq:P-main-2}, we have
	$$\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{\mu_2(\lambda)} q^{|\lambda|} = (z;q)_\infty \sum_{n\ge 0}\frac{z^n}{(q;q)_n(yq;q)_n}.$$
	Recall Heine's third transformation \cite[(III.3), p.~359]{GR2004}:
	$${}_{2}\phi_1\left(\begin{matrix} a,b\\ c \end{matrix}; q, z\right) = \frac{(abz/c;q)_\infty}{(z;q)_\infty} {}_{2}\phi_1\left(\begin{matrix} c/a,c/b\\ c \end{matrix}; q, \frac{abz}{c}\right),$$
	where the ${}_2 \phi_{1}$ series is defined for $|z|<1$ by
	$${}_{2}\phi_1\left(\begin{matrix} a,b\\ c \end{matrix}; q, z\right):=\sum_{n\ge 0}\frac{(a;q)_n(b;q)_n}{(q;q)_n(c;q)_n} z^n.$$
	Putting $a=yq/\tau$, $b=z/\tau$, $c=yq$ and $z=\tau^2$ and letting $\tau\to 0$ in the above, we find that
	$$\lim_{\tau\to 0}{}_{2}\phi_1\left(\begin{matrix} yq/\tau,z/\tau\\ yq \end{matrix}; q, \tau^2\right)=(z;q)_\infty \sum_{n\ge 0}\frac{z^n}{(q;q)_n(yq;q)_n}.$$
	Thus,
	\begin{align}
		\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{\mu_2(\lambda)} q^{|\lambda|} &= \lim_{\tau\to 0}{}_{2}\phi_1\left(\begin{matrix} yq/\tau,z/\tau\\ yq \end{matrix}; q, \tau^2\right)\\
		&=\sum_{n\ge 0}\frac{y^n z^n q^{n^2}}{(yq;q)_n (q;q)_n}.\notag
	\end{align}
	
	On the other hand, given a partition $\lambda$, let $D(\lambda)$ be the length of its Durfee square. It suffices to show that
	$$\sum_{\lambda\in\sP} y^{\ell(\lambda)} z^{D(\lambda)} q^{|\lambda|} = \sum_{n\ge 0}\frac{y^n z^n q^{n^2}}{(yq;q)_n (q;q)_n}.$$
	To see this, we simply decompose a partition with Durfee square of length $n$ as in Figure \ref{fig:Durfee}. Then the Durfee square generates $y^nz^nq^{n^2}$; the block below the Durfee square generates $1/(yq;q)_n$; the block to the right of the Durfee square generates $1/(q;q)_n$. The desired identity therefore follows.
	\begin{figure}[ht]
		\caption{Decomposing a partition with Durfee square of length $n$}\label{fig:Durfee}
		\medskip\medskip
		\centering
		\setlength{\unitlength}{1em}
		\ytableausetup{boxsize=1em}
		\begin{tikzpicture}[x=1em,y=1em]
		\draw(0,0)rectangle (5,-5);
		\draw (0,-5) -- (0,-10);
		\draw (5,-5) -- (5,-7.5);
		\draw (5,0) -- (10,0);
		\draw (5,-5) -- (7.5,-5);
		\node[ below right] at (5.5,-1) {$\dfrac{1}{(q;q)_n}$};
		\node[ below right] at (0.5,-6) {$\dfrac{1}{(yq;q)_n}$};
		\node[ below right] at (0.5,-1.75) {$y^nz^nq^{n^2}$};
		\end{tikzpicture}
	\end{figure}
\end{proof}

Lastly, we show Corollary \ref{coro:P2}.

\begin{proof}[Proof of Corollary \ref{coro:P2}]
	Recall the following special case of the Bailey--Daum summation \cite[Corollary 2.7, p.~21]{And1976}:
	\begin{equation}\label{eq:BD}
		\sum_{n\ge 0}\frac{(a;q)_n q^{n(n+1)/2}}{(q;q)_n} = (-q;q)_\infty (aq;q^2)_\infty.
	\end{equation}
	Setting $k=2$ and $y=z=-1$ in \eqref{eq:P-main}, then
	\begin{align*}
		\sum_{\lambda\in\sP} (-1)^{\ell(\lambda)+\mu_2(\lambda)} q^{|\lambda|}&=\frac{1}{(-q;q)_\infty}\sum_{n\ge 0}\frac{(-1;q)_n q^{n(n+1)/2}}{(q;q)_n}\\
		\text{\tiny (by \eqref{eq:BD})}&= \frac{(-q;q)_\infty (-q;q^2)_\infty}{(-q;q)_\infty}\\
		&=(-q;q^2)_\infty.
	\end{align*}
	This immediately implies the desired result.
\end{proof}

\section{Proof of Theorem \ref{th:D-main}}

In this section, we proceed with a proof of Theorem \ref{th:D-main}.

\begin{proof}[Proof of Theorem \ref{th:D-main}]
	We first divide by $(-yq^2;q)_\infty$ on both sides of \eqref{eq:G-dif}. Then,
	$$(1+yq)\frac{G_k(y)}{(-yq;q)_\infty} - \frac{G_k(yq)}{(-yq^2;q)_\infty} = yzq\frac{G_k(yq^k)}{(-yq^{k+1};q)_\infty}.$$
	Let us define
	$$T_k(y):=\frac{G_k(y)}{(-yq;q)_\infty}.$$
	Thus,
	\begin{align}
		(1+yq)T_k(y)-T_k(yq)=yzqT_k(yq^k).
	\end{align}
	Let us further define
	$$T_k(y):=\sum_{n\ge 0}t_k(n) y^n.$$
	Then $t_k(0)=T_k(0)=G_k(0)=1$. Further, for $n\ge 1$, the above $q$-difference equation for $T_k(y)$ yields
	$$\big(t_k(n)+qt_k(n-1)\big)-t_k(n)q^n = zqt_k(n-1)q^{k(n-1)},$$
	that is,
	$$\frac{t_k(n)}{t_k(n-1)}= \frac{-q(1-zq^{k(n-1)})}{1-q^n}.$$
	We then arrive at
	$$t_k(n)=\frac{(-1)^n q^n (z;q^k)_n}{(q;q)_n},$$
	and therefore,
	$$T_k(y)=\sum_{n\ge 0}\frac{(-1)^n y^n q^n (z;q^k)_n}{(q;q)_n}.$$
	Recalling that $G_k(y)=(-yq;q)_\infty T_k(y)$, we are led to the first part of the theorem.
	
	For the second part, we may set $h=k$, $t\mapsto z$, $b\mapsto -yq$ and let $a,c\to 0$ in \eqref{eq:gen-Heine} to obtain the equivalence between \eqref{eq:D-main} and \eqref{eq:D-main-2}. We also supply a proof using Heine's method as follows.
	\begin{align*}
		G_k(y)&=(-yq;q)_\infty\sum_{n\ge 0}\frac{(-1)^n y^n q^{n} (z;q^{k})_n}{(q;q)_n}\\
		&=(-yq;q)_\infty (z;q^{k})_\infty \sum_{n\ge 0}\frac{(-1)^n y^n q^{n}}{(q;q)_n}\frac{1}{(zq^{kn};q^{k})_\infty}\\
		\text{\tiny (by \eqref{eq:Eul1})}&=(-yq;q)_\infty (z;q^{k})_\infty \sum_{n\ge 0}\frac{(-1)^n y^n q^{n}}{(q;q)_n}\sum_{m\ge 0}\frac{z^m q^{kmn}}{(q^{k};q^{k})_m}\\
		&=(-yq;q)_\infty (z;q^{k})_\infty \sum_{m\ge 0} \frac{z^m}{(q^{k};q^{k})_m} \sum_{n\ge 0}\frac{(-1)^n y^n q^{n+kmn}}{(q;q)_n}\\
		\text{\tiny (by \eqref{eq:Eul1})}&=(-yq;q)_\infty (z;q^{k})_\infty \sum_{m\ge 0} \frac{z^m}{(q^{k};q^{k})_m} \frac{1}{(-yq^{km+1};q)_\infty}\\
		&=(z;q^{k})_\infty \sum_{m\ge 0} \frac{(-yq;q)_{km} z^m}{(q^{k};q^{k})_m}.
	\end{align*}
	This proves \eqref{eq:D-main-2}.
\end{proof}

\section{Conclusion}

From the proofs of Theorems \ref{th:P-main} and \ref{th:D-main}, we have a new witness of the power of $q$-difference equations in the study of partition generating functions. However, the succinctness of the expansions appearing in Theorems \ref{th:P-main} and \ref{th:D-main} suggests that the underlying combinatorics merits further investigation. An anonymous referee has commented that there should be a truly combinatorial proof of our main results, relying on some subtle interpretations of the series on the right-hand sides of \eqref{eq:P-main}--\eqref{eq:D-main-2}. We agree but were unable to produce it. We hope that others will have more success. It is also remarkable that in a recent preprint, Binner \cite{Bin2022} provided a combinatorial treatment of our Corollary \ref{coro:P2}.

Also of significant interest is the fact, as we have pointed out, that all the expansions in Theorems \ref{th:P-main} and \ref{th:D-main} are instances of the generalized Heine transformation \eqref{eq:gen-Heine} due to Andrews, which was further extended by Bhatnagar \cite[Theorem 2.1]{Bha2017}:
\begin{align}\label{eq:Bha}
	\sum_{n\ge 0}\frac{(a;q^h)_n(b;q^j)_{hn} t^n}{(q^h;q^h)_n(c;q^j)_{hn}} = \frac{(b;q^j)_\infty (at;q^h)_\infty}{(c;q^j)_\infty (t;q^h)_\infty} \sum_{n\ge 0} \frac{(c/b;q^j)_n(t;q^h)_{jn} b^n}{(q^j;q^j)_n(at;q^h)_{jn}}.
\end{align}
Such Heine-type transformations play a substantial role in the exploration of many of Ramanujan's identities from his Lost Notebook \cite[p.~6]{AB2009}. This suggests further combinatorial studies of the generalized Heine transformations.


 
\longthanks{We would like to thank an anonymous referee for bringing Bhatnagar's transformation formula \eqref{eq:Bha} to our attention.}


%\nocite{*}
\bibliographystyle{mersenne-plain}
\bibliography{ALCO_Andrews_589.bib}
\end{document}
