\section{Introduction} \label{Sec1}


The study of the distribution of the cokernel of a random $p$-adic matrix for a prime $p$ was initiated by the work of Friedman and Washington \cite{FW89}. They proved that for a finite abelian $p$-group $H$, 
\begin{equation} \label{eq1a}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} ({\operatorname{cok}} (A) \cong H) = \frac{1}{\left | \operatorname{Aut}(H) \right |} \prod_{i=1}^{\infty}(1-p^{-i})
\end{equation}
where $\operatorname{M}_n(\mathbb{Z}_p)$ denotes the set of $n \times n$ matrices over $\mathbb{Z}_p$ and $A$ is random with respect to the Haar probability measure on $\operatorname{M}_n(\mathbb{Z}_p)$. For an odd $p$, the right hand side of the formula (\ref{eq1a}) coincides with the conjectured distribution of the $p$-parts of the class groups of imaginary quadratic fields predicted by Cohen and Lenstra \cite{CL84}. When $p=2$, this coincides with the distribution of $(2 {\operatorname{Cl}}(K))[2^{\infty}]$ (${\operatorname{Cl}}(K)$ denotes the class group of $K$) for imaginary quadratic fields $K$, as conjectured by Gerth \cite{Ger87} and proved by Smith \cite{Smi17}.


Recently, there have been a lot of works which concern the distribution of the cokernels of various types of random matrices over $\mathbb{Z}_p$. 
The distribution of the cokernel of a random symmetric (resp. alternating) matrix over $\mathbb{Z}_p$ was determined by Clancy, Kaplan, Leake, Payne and Wood \cite{CKLPW15} (resp. Bhargava, Kane, Lenstra, Poonen and Rains \cite{BKLPR15}). 
A model of the $p$-parts of the Tate-Shafarevich groups of elliptic curves over $\mathbb{Q}$ in terms of the cokernels of random alternating matrices was also suggested in \cite{BKLPR15}.
Wood \cite{Woo19} extended the formula (\ref{eq1a}) to a large family of random matrices in $\operatorname{M}_n(\mathbb{Z}_p)$ whose entries are independent and their reductions modulo $p$ are not too concentrated. 
The key step of the proof of such universality result is to determine the moments of the cokernels of random matrices. See also \cite{NW22, Woo17} for more works in this direction. 


Friedman and Washington also proved that
\begin{equation} \label{eq1b}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} ({\operatorname{cok}} (A-I_n) \cong H) = \lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} ({\operatorname{cok}} (A) \cong H)
\end{equation}
($I=I_n$ denotes the $n \times n$ identity matrix) for every finite abelian $p$-group $H$, which means that the events ${\operatorname{cok}}(A) = 0$ and ${\operatorname{cok}}(A-I_n) \cong H$ become independent as $n \rightarrow \infty$. 
As a natural generalization, Cheong and Huang \cite{CH21} suggested a conjecture on the joint distribution of ${\operatorname{cok}}(P_1(A)), \cdots, {\operatorname{cok}}(P_l(A))$ where $P_1(t), \cdots, P_l(t) \in \mathbb{Z}_p[t]$ are monic polynomials whose reductions modulo $p$ in $\mathbb{F}_p[t]$ are distinct and irreducible, and $A \in \operatorname{M}_n(\mathbb{Z}_p)$ is a random matrix. 
Cheong and Kaplan \cite{CK22} modified the conjecture and proved the following proposition by counting the number of matrices with given cokernel conditions and a given reduction modulo $p$.

\begin{proposition} \label{prop11}
(\cite[Theorem 1.1]{CK22}) Let $P_1(t), \cdots, P_l(t) \in \mathbb{Z}_p[t]$ be monic polynomials whose reductions modulo $p$ in $\mathbb{F}_p[t]$ are distinct and irreducible, and let $H_j$ be a finite module over $R_j := \mathbb{Z}_p[t]/(P_j(t))$ for each $1 \leq j \leq l$. Assume that $\deg (P_j) \leq 2$ for each $j$. Then we have
\begin{equation} \label{eq1c}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_j(A)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} 
= \prod_{j=1}^{l} \left ( \frac{1}{\left | \operatorname{Aut}_{R_j}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i \deg (P_j)}) \right ).
\end{equation}
\end{proposition}
The above proposition implies that the distributions of the cokernels ${\operatorname{cok}}(P_j(A))$ ($1 \leq j \leq l$) become independent as $n \rightarrow \infty$. To clarify the above proposition, we note the followings. 

\begin{itemize}
    \item Each $R_j$ is a complete discrete valuation ring with a finite residue field $\mathbb{F}_p[t]/(\overline{P_j}(t)) \cong \mathbb{F}_{p^{\deg (P_j)} }$. This follows from the fact that the reduction modulo $p$ of each $P_j(t)$ is irreducible.
    
    \item The cokernel ${\operatorname{cok}}(P_j(A))$ has a natural $R_j$-module structure defined by $t \cdot x := Ax$. 
\end{itemize}

The first main theorem of the paper shows that the above proposition holds without any restriction on the degree of the polynomials. Our proof is based on probabilistic arguments using Lemma \ref{lem21b}, which is different from the proof of Proposition \ref{prop11} relies on the reduction modulo $p$. Its proof is given in Section \ref{Sub22} and the lemmas that will be used in the proof are summarized in Section \ref{Sub21}. 

\begin{theorem} \label{thm12}
(Theorem \ref{mainthm1}) Proposition \ref{prop11} is true without the assumption $\deg (P_j) \leq 2$.
\end{theorem}

The relations between Theorem \ref{thm12} and the linearization of a random matrix model introduced by Lipnowski, Sawin and Tsimerman \cite{LST20} are discussed in Section \ref{Sec3}. 
In Section \ref{Sub31}, first we briefly explain the idea of the linearization.
After that, we provide a heuristic argument based on Theorem \ref{thm12} which suggests one possible way to understand a surprising result of \cite{LST20}: a non-linear random matrix model and its linearization have the same distribution.


Theorem \ref{thm12} is no longer true when there are two polynomials $P_{j_1}(t)$ and $P_{j_2}(t)$ with the same reduction modulo $p$. 
In this case, two cokernels ${\operatorname{cok}}(P_{j_1}(A))$ and ${\operatorname{cok}}(P_{j_2}(A))$ have the same $p$-rank so they can never be independent.
Nevertheless, it is still possible to consider the joint distribution of the cokernels ${\operatorname{cok}}(P_j(A))$ ($1 \leq j \leq l$).
Section \ref{Sub32} contains a conjectural generalization of Theorem \ref{thm12} (i.e. Conjecture \ref{conj32b}) for such polynomials, which is inspired by a heuristic argument based on the linearization.


Proposition \ref{prop11} (or Theorem \ref{thm12}) implies that for a random matrix $A \in \operatorname{M}_n(\mathbb{Z}_p)$, the cokernels ${\operatorname{cok}}(A)$ and ${\operatorname{cok}}(A+I_n)$ become independent as $n \rightarrow \infty$. 
One may ask under which conditions the cokernels ${\operatorname{cok}}(A)$ and ${\operatorname{cok}}(A+B_n)$ become independent, where $\left \{ B_n \right \}_{n \geq 1}$ is a sequence of matrices such that $B_n \in \operatorname{M}_n(\mathbb{Z}_p)$.
The second main theorem states that such independence phenomenon holds if the $p$-rank of ${\operatorname{cok}}(B_n)$ is not too close to $n$ (equivalently, the rank of $\overline{B_n} \in \operatorname{M}_n(\mathbb{F}_p)$ is not too small). 
For a finitely generated $\mathbb{Z}_p$-module $M$, denote its $p$-rank by $r_p(M) := \operatorname{rank}_{\mathbb{F}_p}(M /pM)$. 
\begin{theorem} \label{thm13}
(Theorem \ref{mainthm2}) Let $\left \{ B_n \right \}_{n \geq 1}$ be any sequence of matrices such that $B_n \in \operatorname{M}_n(\mathbb{Z}_p)$ and
\begin{equation} \label{eq1d}
\lim_{n \rightarrow \infty} (n - \log_p n - r_p({\operatorname{cok}}(B_n)) ) = \infty.
\end{equation}
Then for every finite abelian $p$-groups $H_1$ and $H_2$, we have
\begin{equation} \label{eq1e}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) \cong H_1 \text{ and } \\ 
{\operatorname{cok}}(A+B_n) \cong H_2
\end{pmatrix} = \prod_{j=1}^{2} \left ( \frac{1}{\left | \operatorname{Aut}_{\mathbb{Z}_p}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i}) \right ).
\end{equation}
\end{theorem}

We hope to extend our results to various types of random matrices over $\mathbb{Z}_p$. For example, one may calculate the distribution of ${\operatorname{cok}}(A^2+I_n)$ or the joint distribution of ${\operatorname{cok}}(A)$ and ${\operatorname{cok}}(A+I_n)$ for a random symmetric $n \times n$ matrix $A$ over $\mathbb{Z}_p$. 
Also it would be interesting to find more connections between our results and the linearization of a random matrix model, starting from the discussions in Section \ref{Sec3}.



\section{Joint distribution of the cokernels of multiple polynomials of a random $p$-adic matrix} \label{Sec2}

The purpose of this section is to prove the following theorem.

\begin{theorem} \label{mainthm1}
Let $P_1(t), \cdots, P_l(t) \in \mathbb{Z}_p[t]$ be monic polynomials whose reductions modulo $p$ in $\mathbb{F}_p[t]$ are distinct and irreducible, and let $H_j$ be a finite module over $R_j := \mathbb{Z}_p[t]/(P_j(t))$ for each $1 \leq j \leq l$. Then we have
\begin{equation} \label{eq20a}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_j(A)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} 
= \prod_{j=1}^{l} \left ( \frac{1}{\left | \operatorname{Aut}_{R_j}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i \deg (P_j)}) \right ).
\end{equation}
\end{theorem}

\subsection{Some lemmas} \label{Sub21}

Before starting the proof, we provide some lemmas that will be useful for the proof. The first lemma provides a linear description of the cokernel of a matrix polynomial. 

\begin{lemma} \label{lem21a}
(cf. \cite[Lemma 3.2]{CK22}) For each $j$, the map 
$$
\mathbb{Z}_p^n/P_j(A) \mathbb{Z}_p^n = {\operatorname{cok}}(P_j(A)) \rightarrow {\operatorname{cok}}_{R_j}(A-tI) := R_j^n / (A-tI)R_j^n \;\; (\overline{x} \mapsto \overline{x})
$$
($A \in \operatorname{M}_n(\mathbb{Z}_p)$, $A-tI \in \operatorname{M}_n(R_j)$) is an $R_j$-module isomorphism.
\end{lemma}


For $A \in \operatorname{M}_n(\mathbb{Z}_p)$ and $P, Q \in \operatorname{GL}_n(\mathbb{Z}_p)$, we have ${\operatorname{cok}}(A) \cong {\operatorname{cok}}(PAQ)$ so the elementary operations do not change the cokernel of a matrix. The key tool in the proof of Theorem \ref{mainthm1} is the reduction of the size of a matrix by elementary operations without affecting the cokernels. The next lemma will be repeatedly used in this procedure. 

\begin{lemma} \label{lem21b}
For any integers $n \geq r > 0$ and a Haar-random matrix $C \in \operatorname{M}_{n \times r}(\mathbb{Z}_p)$, we have
$$
\underset{C \in \operatorname{M}_{n \times r}(\mathbb{Z}_p)}{\operatorname{Prob}} \left ( \text{there exists } Y \in \operatorname{GL}_{n}(\mathbb{Z}_p) \text{ such that } YC = \begin{pmatrix}
I_r \\
O
\end{pmatrix} \right ) \geq c_{n,r} := \prod_{j=0}^{r-1} \left ( 1 - \frac{1}{p^{n-j}} \right ).
$$
\end{lemma}

\begin{proof}
We will prove that
\begin{equation} \label{eq21a}
\underset{C \in \operatorname{M}_{n \times r}(\mathbb{Z}_p)}{\operatorname{Prob}} \left ( \text{there exists } Y \in \operatorname{GL}_{n}(\mathbb{Z}_p) \text{ such that } YC = \left(\begin{array}{@{}c|c@{}}
    I_u & * \\\hline
    O & *
  \end{array}\right) \right ) \geq c_{n,u}
\end{equation}
for any $0 \leq u \leq r$ by induction on $u$. The case $u=0$ is trivial. Suppose that the equation (\ref{eq21a}) holds for a given $u \leq r-1$. Then there exists $Y_0 \in \operatorname{GL}_{n}(\mathbb{Z}_p)$ such that 
$$Y_0 C = \left(\begin{array}{@{}c|c@{}}
    I_u & \begin{matrix}
c_1 & \\ 
\vdots & * \\ 
c_u & 
\end{matrix} \\\hline
    O & C_2
  \end{array}\right)$$ 
  with a probability at least $c_{n,u}$. For a random matrix $C_2 \in \operatorname{M}_{(n-u) \times (r-u)}(\mathbb{Z}_p)$, we have
  $$
  \operatorname{Prob} \, ((C_2)_{*1} \in \mathbb{Z}_p^{n-u} \setminus (p \mathbb{Z}_p)^{n-u}) = 1 - \frac{1}{p^{n-u}} = \frac{c_{n, u+1}}{c_{n, u}}
  $$
  where $(C_2)_{*1}$ denotes the first column of $C_2$. In this case there exists $Y_1 \in \operatorname{GL}_{n-u}(\mathbb{Z}_p)$ such that $Y_1 (C_2)_{*1} = \begin{pmatrix}
1 & 0 & \cdots & 0 
\end{pmatrix}^T$. Now we have

  $$
  \left(\begin{array}{@{}c|c@{}}
    I_u & \begin{matrix}
-c_1 & \\ 
\vdots & O \\ 
-c_u & 
\end{matrix} \\\hline
    O & I_{n-u}
  \end{array}\right) \left(\begin{array}{@{}c|c@{}}
    I_u & O \\\hline
    O & Y_1
  \end{array}\right) Y_0 C = \left(\begin{array}{@{}c|c@{}}
    I_{u+1} & * \\\hline
    O & *
  \end{array}\right),
  $$
which finishes the proof.
\end{proof}

\begin{lemma} \label{lem21c}
For $R_0 := \mathbb{Z}_p[t]/(P_1(t) \cdots P_l(t))$, the map
$$
\operatorname{M}_n(R_0) \rightarrow \prod_{j=1}^{l} \operatorname{M}_n(R_j) \;\; (A \mapsto (\overline{A}, \cdots, \overline{A}))
$$
is a ring isomorphism.
\end{lemma}

\begin{proof}
First we prove that for every $i \neq j$, the ideals $(P_i), (P_j)$ in $\mathbb{Z}_p[t]$ are coprime. Since $\overline{P_i}, \overline{P_j} \in \mathbb{F}_p[t]$ are distinct and irreducible, there are $a_i, a_j, a \in \mathbb{Z}_p[t]$ such that $a_iP_i+a_jP_j = 1 + pa$. 
Also since $P_i$ and $P_j$ are irreducible over $\mathbb{Q}_p$, there are $b_i, b_j \in \mathbb{Q}_p[t]$ such that $b_iP_i+b_jP_j=1$ so we can choose $b_i', b_j' \in \mathbb{Z}_p[t]$ such that $b_i'P_i+b_j'P_j=p^u$ for some $u \in \mathbb{Z}_{\geq 0}$. 
Now we have $(a_iP_i+a_jP_j-1)^u=a^u(b_i'P_i+b_j'P_j)$ so there are $c_i, c_j \in \mathbb{Z}_p[t]$ such that $c_iP_i+c_jP_j=1$. 


Since the ideals $(P_1), \cdots, (P_l)$ in $\mathbb{Z}_p[t]$ are pairwise coprime, the map
$$
R_0 \rightarrow \prod_{j=1}^{l} R_j \;\; (x \mapsto (x+(P_1), \cdots, x+(P_l)))
$$
is a ring isomorphism by the Chinese remainder theorem. Therefore the map $\displaystyle \operatorname{M}_n(R_0) \rightarrow \prod_{j=1}^{l} \operatorname{M}_n(R_j)$ is also a ring isomorphism. 
\end{proof}


\subsection{Proof of Theorem \ref{mainthm1}} \label{Sub22}

By Lemma \ref{lem21a}, Theorem \ref{mainthm1} is equivalent to 
\begin{equation} \label{eq22a}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(A-tI) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} 
= \prod_{j=1}^{l} \left ( \frac{1}{\left | \operatorname{Aut}_{R_j}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i \deg (P_j)}) \right ).
\end{equation}
For $M \in \operatorname{M}_n(\mathbb{Z}_p[t])$, denote its image in $\operatorname{M}_n(R_j)$ by $M(j)$. For any $n>r>0$ and $k \geq 0$, denote
$$
P_{n, r}^{k} := \underset{\substack{A \in \operatorname{M}_n(\mathbb{Z}_p) \\ B_1, \cdots, B_k \in \operatorname{M}_{r \times n}(\mathbb{Z}_p)}}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(M_{A, \, [B_1, \cdots, B_k]}(j)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} 
$$
for
$$
M_{A, \, [B_1, \cdots, B_k]} := A + \begin{pmatrix}
\sum_{i=1}^{k} t^iB_i \\ 
O_{(n-r) \times n}
\end{pmatrix}
- \begin{pmatrix}
t^{k+1} I_r & O \\ 
O & t I_{n-r}
\end{pmatrix} \in \operatorname{M}_n(\mathbb{Z}_p[t]).
$$
It is obvious that
\begin{equation} \label{eq22b}
P_{n, r}^{0} = \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(A-tI) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix}. 
\end{equation}

\noindent For $n > 2r > 0$, $A = \begin{pmatrix}
A_1 & A_2 \\ 
A_3 & A_4
\end{pmatrix} \in \operatorname{M}_{r+(n-r)}(\mathbb{Z}_p)$, $B_1, \cdots, B_k \in \operatorname{M}_{r \times n}(\mathbb{Z}_p)$ and 
  $$
  U = \begin{pmatrix}
    I_r & O \\
    O & U_1
  \end{pmatrix} \in \operatorname{GL}_{n}(\mathbb{Z}_p) \;\; (U_1 \in \operatorname{GL}_{n-r}(\mathbb{Z}_p)),
  $$
we have
\begin{equation*}
U M_{A, \, [B_1, \cdots, B_k]} U^{-1} 
= M_{ A', \,  [B_1', \cdots, B_k']}
\end{equation*}
for
\begin{equation*}
A' = \begin{pmatrix}
    A_1 & A_2U_1^{-1} \\
    U_1A_3 & U_1A_4U_1^{-1}
  \end{pmatrix}, \, B_i'=B_i U^{-1}
\end{equation*}
by a direct computation. Note that for any fixed $A_3$ and $U_1$, the matrices $A_2U_1^{-1}$, $U_1A_4U_1^{-1}$ and $B_iU^{-1}$ ($1 \leq i \leq k$) are random if and only if the matrices $A_2$, $A_4$ and $B_i$ are random. By Lemma \ref{lem21b}, we may assume that $U_1A_3 = \begin{pmatrix}
I_r \\
O
\end{pmatrix}$ with a probability at least $c_{n-r, r}$. This implies that
\begin{equation} \label{eq22c}
\left | P_{n, r}^{k} - \widetilde{P}_{n, r}^{k} \right | \leq 1-c_{n-r, r}
\end{equation}
for
$$
\widetilde{\operatorname{M}}_{n, r}(\mathbb{Z}_p) := \left \{ \begin{pmatrix}
A_1 & A_2 & A_3\\ 
I_r & A_4 & A_5\\ 
O & A_6 & A_7
\end{pmatrix} \in \operatorname{M}_{r+r+(n-2r)}(\mathbb{Z}_p) \right \} \subset \operatorname{M}_n(\mathbb{Z}_p)$$
and
$$
\widetilde{P}_{n, r}^{k} := \underset{\substack{A \in \widetilde{\operatorname{M}}_{n, r}(\mathbb{Z}_p) \\ B_1, \cdots, B_k \in \operatorname{M}_{r \times n}(\mathbb{Z}_p)}}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(M_{A, \, [B_1, \cdots, B_k]}(j)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} .
$$
Let
$$
A = \begin{pmatrix}
A_1 & A_2 & A_3 \\ 
I_r & A_4 & A_5 \\ 
O & A_6 & A_7 
\end{pmatrix} \in \widetilde{\operatorname{M}}_{n, r}(\mathbb{Z}_p)
$$
and 
$$
B_i = \begin{pmatrix}
X_i & Y_i & Z_i
\end{pmatrix} \in \operatorname{M}_{r \times (r+r+(n-2r))}(\mathbb{Z}_p)
$$
for $1 \leq i \leq k$. By elementary operations, we have
\begin{equation*}
\small
\begin{split}
& \; M_{A, \, [B_1, \cdots, B_k]} \\
= & \, \left(\begin{array}{@{}c|c|c@{}}
    A_1 + \sum_{i=1}^{k} t^iX_i - t^{k+1}I_r & A_2 + \sum_{i=1}^{k} t^iY_i & A_3 + \sum_{i=1}^{k} t^iZ_i \\\hline
I_r & A_4-tI_r & A_5 \\\hline
    O & A_6 & A_7-tI_{n-2r} 
  \end{array}\right) \\
\Rightarrow & \, \left(\begin{array}{@{}c|c|c@{}}
    O & (A_2 + \sum_{i=1}^{k} t^iY_i)-(A_1 + \sum_{i=1}^{k} t^iX_i - t^{k+1}I_r)(A_4-tI_r) & (A_3 + \sum_{i=1}^{k} t^iZ_i)-(A_1 + \sum_{i=1}^{k} t^iX_i - t^{k+1}I_r)A_5 \\\hline
    I_r & A_4-tI_r & A_5 \\\hline
    O & A_6 & A_7-tI_{n-2r} 
  \end{array}\right) \\
\Rightarrow & \, \left(\begin{array}{@{}c|c@{}}
    (A_2 + \sum_{i=1}^{k} t^iY_i)-(A_1 + \sum_{i=1}^{k} t^iX_i - t^{k+1}I_r)(A_4-tI_r) & (A_3 + \sum_{i=1}^{k} t^iZ_i)-(A_1 + \sum_{i=1}^{k} t^iX_i - t^{k+1}I_r)A_5 \\ \hline
    A_6 & A_7-tI_{n-2r} 
  \end{array}\right) \\
= & \, \left(\begin{array}{@{}c|c@{}}
    A_2-A_1A_4 & A_3-A_1A_5 \\ \hline
    A_6 & A_7
  \end{array}\right) \\
  & + \left(\begin{array}{@{}c|c@{}}
  t(Y_1-X_1A_4+A_1)
  + \sum_{i=2}^{k} t^i(Y_i-X_iA_4+X_{i-1})
  + t^{k+1}(A_4+X_k)
  & \sum_{i=1}^{k} t^i(Z_i-X_iA_5) + t^{k+1}A_5 \\ \hline
  O & O
  \end{array}\right) \\
  & - \left(\begin{array}{@{}c|c@{}}
    t^{k+2}I_r & O \\ \hline
    O & tI_{n-2r} 
  \end{array}\right) \\
  =: & \, M_{A', \, [B_1', \cdots, B_{k+1}']}.
\end{split}
\end{equation*}
Since the elementary operations do not change the cokernel, we have
$$
{\operatorname{cok}}(M_{A, \, [B_1, \cdots, B_k]}(j)) \cong {\operatorname{cok}}(M_{A', \, [B_1', \cdots, B_{k+1}']}(j))
$$
for all $j$. 
For given $A_1$ and $X_i$ ($1 \leq i \leq k$), the matrices $B_1', \cdots, B_{k+1}'$ are random if $Y_i$, $Z_i$, $A_4$ and $A_5$ are random. Similarly, for given $A_1$, $A_4$ and $A_5$, $A'$ is random if $A_2$, $A_3$, $A_6$ and $A_7$ are random. 
Therefore $A', B_1', \cdots, B_{k+1}'$ are random if $A, B_1, \cdots, B_k$ are random, which implies that
\begin{equation} \label{eq22d}
\widetilde{P}_{n, r}^{k} = P_{n-r, r}^{k+1}.
\end{equation}
By the equations (\ref{eq22c}) and (\ref{eq22d}), we have
\begin{equation} \label{eq22e}
\begin{split}
\left | P_{n,r}^{0} - P_{n-(d-1)r,r}^{d-1} \right |
& \leq \sum_{i=1}^{d-1} \left | P_{n-(i-1)r,r}^{i-1} - P_{n-ir,r}^{i} \right | \\
& \leq \sum_{i=1}^{d-1} (1 - c_{n-ir, r})
\end{split}
\end{equation}
for $d := \deg (P_1) + \cdots + \deg (P_l)$ and $n>dr$. 

Now let $r>s>0$ and consider the probability $P_{r+s, r}^{d-1}$. For $A = \begin{pmatrix}
A_1 & A_2 \\
    A_3 & A_4
\end{pmatrix} \in \operatorname{M}_{r+s}(\mathbb{Z}_p)$, $B_i = \begin{pmatrix}
X_i & Y_i
\end{pmatrix} \in \operatorname{M}_{r \times (r+s)}(\mathbb{Z}_p)$ and 
  $$
  U = \begin{pmatrix}
    U_2 & O \\
    O & I_{s}
  \end{pmatrix} \in \operatorname{GL}_{r+s}(\mathbb{Z}_p) \;\; (U_2 \in \operatorname{GL}_{r}(\mathbb{Z}_p)),
  $$
we have
\begin{equation*}
U M_{A, \, [B_1, \cdots, B_{d-1}]} U^{-1} 
= M_{ A', \,  [B_1', \cdots, B_{d-1}']}
\end{equation*}
for
\begin{equation*}
A' = \begin{pmatrix}
    U_2A_1U_2^{-1} & U_2A_2 \\
    A_3U_2^{-1} & A_4
  \end{pmatrix}, \, B_i'= \begin{pmatrix}
U_2X_iU_2^{-1} & U_2Y_i
\end{pmatrix}.
\end{equation*}
Note that for any fixed $A_3$ and $U_2$, the matrices $U_2A_1U_2^{-1}$, $U_2A_2$, $U_2X_iU_2^{-1}$ and $U_2Y_i$ ($1 \leq i \leq d-1$) are random if and only if the matrices $A_1$, $A_2$, $X_i$ and $Y_i$ are random. By Lemma \ref{lem21b}, we may assume that $A_3U_2^{-1} = \begin{pmatrix}
I_{s} & O
\end{pmatrix}$ with a probability at least $c_{r, s}$. This implies that
\begin{equation} \label{eq22f}
\left | P_{r+s, r}^{d-1} - \widehat{P}_{r+s, s}^{d-1} \right | \leq 1-c_{r, s}
\end{equation}
for
$$
\widehat{\operatorname{M}}_{r+s, s}(\mathbb{Z}_p) := \left \{ \begin{pmatrix}
A_1 & A_2 & A_3\\ 
I_{s} & O & A_4
\end{pmatrix} \in \operatorname{M}_{(r+s) \times (s+(r-s)+s)}(\mathbb{Z}_p) \right \} \subset \operatorname{M}_{r+s}(\mathbb{Z}_p)$$
and
$$
\widehat{P}_{r+s, s}^{d-1} := \underset{\substack{A \in \widehat{\operatorname{M}}_{r+s, s}(\mathbb{Z}_p) \\ B_1, \cdots, B_{d-1} \in \operatorname{M}_{r \times (r+s)}(\mathbb{Z}_p)}}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(M_{A, \, [B_1, \cdots, B_{d-1}]}(j)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix}.
$$
Let
$$
A = \begin{pmatrix}
A_1 & A_2 & A_3\\ 
A_4 & A_5 & A_6\\
I_{s} & O & A_7
\end{pmatrix} \in \widehat{\operatorname{M}}_{r+s, s}(\mathbb{Z}_p) \subset \operatorname{M}_{s+(r-s)+s}(\mathbb{Z}_p)
$$
and
$$
B_i = \begin{pmatrix}
B_{i, 1} & B_{i, 2} & B_{i, 3}\\
B_{i, 4} & B_{i, 5} & B_{i, 6}
\end{pmatrix} \in \operatorname{M}_{(s+(r-s)) \times (s+(r-s)+s)}(\mathbb{Z}_p)
$$ 
for $1 \leq i \leq d-1$. By elementary operations, we have
\begin{equation*}
\small
\begin{split}
& \; M_{A, \, [B_1, \cdots, B_{d-1}]} \\
= & \, \left(\begin{array}{@{}c|c|c@{}}
    A_1 + \sum_{i=1}^{d-1} t^iB_{i, 1} - t^{d}I_s & A_2 + \sum_{i=1}^{d-1} t^iB_{i, 2} & A_3 + \sum_{i=1}^{d-1} t^iB_{i, 3} \\\hline
A_4 + \sum_{i=1}^{d-1} t^iB_{i, 4} & A_5 + \sum_{i=1}^{d-1} t^iB_{i, 5} -t^{d}I_{r-s} & A_6+ \sum_{i=1}^{d-1} t^iB_{i, 6} \\\hline
    I_s & O & A_7-tI_{s} 
  \end{array}\right) \\
\Rightarrow & \, \left(\begin{array}{@{}c|c|c@{}}
    A_1 + \sum_{i=1}^{d-1} t^iB_{i, 1} - t^{d}I_s & A_2 + \sum_{i=1}^{d-1} t^iB_{i, 2} & (A_3 + \sum_{i=1}^{d-1} t^iB_{i, 3}) - (A_1 + \sum_{i=1}^{d-1} t^iB_{i, 1} - t^{d}I_s)(A_7-tI_{s}) \\\hline
A_4 + \sum_{i=1}^{d-1} t^iB_{i, 4} & A_5 + \sum_{i=1}^{d-1} t^iB_{i, 5} -t^{d}I_{r-s} & (A_6 + \sum_{i=1}^{d-1} t^iB_{i, 6}) - (A_4 + \sum_{i=1}^{d-1} t^iB_{i, 4})(A_7-tI_{s}) \\\hline
    I_s & O & O
  \end{array}\right) \\
\Rightarrow & \, \left(\begin{array}{@{}c|c@{}}
    A_2 + \sum_{i=1}^{d-1} t^iB_{i, 2} & (A_3 + \sum_{i=1}^{d-1} t^iB_{i, 3}) - (A_1 + \sum_{i=1}^{d-1} t^iB_{i, 1} - t^{d}I_s)(A_7-tI_{s}) \\\hline
A_5 + \sum_{i=1}^{d-1} t^iB_{i, 5} -t^{d}I_{r-s} & (A_6 + \sum_{i=1}^{d-1} t^iB_{i, 6}) - (A_4 + \sum_{i=1}^{d-1} t^iB_{i, 4})(A_7-tI_{s})
  \end{array}\right) \\
= & \, \left(\begin{array}{@{}c|c@{}}
    A_2 & A_3-A_1A_7 \\ \hline
    A_5 & A_6-A_4A_7
  \end{array}\right) + t \left(\begin{array}{@{}c|c@{}}
    B_{1,2} & B_{1, 3}+A_1-B_{1,1}A_7 \\ \hline
    B_{1,5} & B_{1, 6}+A_4-B_{1,4}A_7
  \end{array}\right) \\
  & + \sum_{i=2}^{d-1} t^i \left(\begin{array}{@{}c|c@{}}
  B_{i, 2} & B_{i,3}-B_{i,1}A_7+B_{i-1,1} \\ \hline
  B_{i, 5} & B_{i,6}-B_{i,4}A_7+B_{i-1,4}
  \end{array}\right) + \left(\begin{array}{@{}c|c@{}}
    O & t^d(B_{d-1, 1}+A_7)-t^{d+1}I_s \\ \hline
    -t^d I_{r-s} & t^dB_{d-1, 4}
  \end{array}\right) \\
  = & \, \sum_{i=0}^{d-1}t^iC_i + t^d \begin{pmatrix} O & E
\end{pmatrix} 
+ \begin{pmatrix}  
O & -t^{d+1}I_s \\
-t^d I_{r-s} & O
\end{pmatrix} \\
=: & \, N_{[C_0, \cdots, C_{d-1}], E} \in \operatorname{M}_r(\mathbb{Z}_p[t])
\end{split}
\end{equation*}
for $C_0, \cdots, C_{d-1} \in \operatorname{M}_{r}(\mathbb{Z}_p)$ and $E \in \operatorname{M}_{r \times s}(\mathbb{Z}_p)$. 
For given $A_1$, $A_4$, $A_7$, $B_{i,1}$ and $B_{i,4}$ ($1 \leq i \leq d-2$), the matrices $C_0, \cdots, C_{d-1}, E$ are random if $A_j$, $B_{i, j}$ ($1 \leq i \leq d-1$, $j \in \left\{ 2, 3, 5, 6 \right\}$), $B_{d-1, 1}$ and $B_{d-1, 4}$ are random. 
In this case, the image of $N_{[C_0, \cdots, C_{d-1}], E}$ in $\operatorname{M}_r(R_0)$ is also random so Lemma \ref{lem21c} implies that 
$$
N_{[C_0, \cdots, C_{d-1}], E}(j) \in \operatorname{M}_r(R_j) \;\; (1 \leq j \leq l)
$$
are random and independent. Therefore
\begin{equation} \label{eq22g}
\begin{split}
\widehat{P}_{r+s, s}^{d-1} 
& = \underset{\substack{C_0, \cdots, C_{d-1} \in \operatorname{M}_{r}(\mathbb{Z}_p) \\ E \in \operatorname{M}_{r \times s}(\mathbb{Z}_p)}}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(N_{[C_0, \cdots, C_{d-1}], E}(j)) \cong H_j \\ 
\text{ for } 1 \leq j \leq l 
\end{pmatrix} \\
& = \prod_{j=1}^{l} \left ( \underset{B_j \in \operatorname{M}_{r}(R_j)}{\operatorname{Prob}} ({\operatorname{cok}}(B_j) \cong H_j)  \right ).
\end{split}
\end{equation}
(Each $B_j$ is a Haar-random matrix in $\operatorname{M}_{r}(R_j)$.) By the equations (\ref{eq22f}) and (\ref{eq22g}), we have
\begin{equation} \label{eq22h}
\left | P_{r+s, r}^{d-1} - \prod_{j=1}^{l} \left ( \underset{B_j \in \operatorname{M}_{r}(R_j)}{\operatorname{Prob}} ({\operatorname{cok}}(B_j) \cong H_j)  \right ) \right | \leq 1-c_{r, s}.
\end{equation}

Now let $(t_n)_{n \geq 1}$ be any sequence of non-negative integers such that 
$$
\lim_{n \rightarrow \infty} (n-dt_n) = \lim_{n \rightarrow \infty} ((d+1)t_n-n) = \infty
$$
and denote $s_n := n - dt_n$. Assume that $n$ is sufficiently large so that both $s_n$ and $t_n-s_n$ are positive. By the equations (\ref{eq22b}), (\ref{eq22e}) and (\ref{eq22h}), we have
\begin{equation*}
\begin{split}
& \left | \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(A-tI) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix} - \prod_{j=1}^{l} \left ( \underset{B_j \in \operatorname{M}_{t_n}(R_j)}{\operatorname{Prob}} ({\operatorname{cok}}(B_j) \cong H_j)  \right ) \right | \\
\leq & \, \sum_{i=1}^{d-1} (1 - c_{n-it_n, t_n}) + (1-c_{t_n, s_n}).
\end{split}
\end{equation*}
Here we take $r=t_n$ in the equation (\ref{eq22e}) and $(r,s)=(t_n, s_n)$ in the equation (\ref{eq22h}). 
Since both $t_n-s_n$ and $s_n$ go to infinity as $n \rightarrow \infty$, we have
$$
\lim_{n \rightarrow \infty} (\sum_{i=1}^{d-1} (1 - c_{n-it_n, t_n}) + (1-c_{t_n, s_n})) = 0
$$
so
\begin{equation*}
\begin{split}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}_{R_j}(A-tI) \cong H_j \\ 
\text{ for } 1 \leq j \leq l
\end{pmatrix}
& = \lim_{n \rightarrow \infty} \prod_{j=1}^{l} \left ( \underset{B_j \in \operatorname{M}_{t_n}(R_j)}{\operatorname{Prob}} ({\operatorname{cok}}(B_j) \cong H_j)  \right ) \\
& = \prod_{j=1}^{l} \left ( \frac{1}{\left | \operatorname{Aut}_{R_j}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i \deg (P_j)}) \right )
\end{split}
\end{equation*}
by \cite[Proposition 2.1]{CH21}. This finishes the proof of Theorem \ref{mainthm1}. $\square$



\section{Linearization} \label{Sec3}

\subsection{Linearization of a random matrix model} \label{Sub31}

We assume that $p$ is odd in this section.
The original motivation of the formula (\ref{eq1b}) by Friedman and Washington was the function field analogue of the Cohen-Lenstra conjecture. 
They suggested that the distribution of ${\operatorname{cok}}(I-F)$ for a random matrix $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ converges to the distribution of the $p$-parts of the class groups of imaginary (i.e. ramified at $\infty$) quadratic extensions of $\mathbb{F}_q(t)$ as $g \rightarrow \infty$. Here $\operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ denotes the subset of $\operatorname{GSp}_{2g}(\mathbb{Z}_p)$ consisting of symplectic similitudes of similitude factor $q$. Instead of calculating the distribution of ${\operatorname{cok}}(I-F)$ for $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$, they calculated the distribution of ${\operatorname{cok}}(I-F)$ for $F \in \operatorname{GL}_{2g}(\mathbb{Z}_p)$. 

Achter \cite{Ach06} showed that the distribution of ${\operatorname{cok}}(I-F)$ for $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ does not agree with the distribution of ${\operatorname{cok}}(I-F)$ for $F \in \operatorname{M}_{2g}(\mathbb{Z}_p)$, which disproves the conjecture of Friedman and Washington. It turns out that the distribution of ${\operatorname{cok}}(I-F)$ for $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ depends on the exponent of $p$ in $q-1$. Garton \cite[Corollary 5.2.2]{Gar15} calculated the $g \rightarrow \infty$ limit of this distribution in the cases $p^v \parallel  q-1$ for $v \in \left\{ 1, 2 \right\}$. Lipnowski, Sawin and Tsimerman \cite[Theorem 8.11]{LST20} extended this result to every positive integer $v$. (Note that in the statement of \cite[Theorem 8.11]{LST20}, $n \rightarrow \infty$ should be changed to $g \rightarrow \infty$.) The linearization of a random matrix model plays a crucial role in their work.


We introduce the linearization of a random matrix model following the exposition in \cite{LST20}. Assume that $p^v \parallel q-1$ for some $v>0$. For $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$, consider its logarithm 
$$
\log (F) := \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k}(F-I)^k = (F-I) \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k}(F-I)^{k-1}.
$$
If $F \equiv I \;\; (\text{mod } p)$, then the above series converges and ${\operatorname{cok}}(\log (F)) \cong {\operatorname{cok}} (F-I)$. By the definition of $\operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$, we have $\displaystyle \frac{F}{q^{\frac{1}{2}}} \in \operatorname{Sp}_{2g}(\mathbb{Z}_p)$ so $\displaystyle \log (F) = M + \frac{1}{2} \log (q) I$ for some $M \in \mathfrak{sp}_{2g}(\mathbb{Z}_p)$. Since $p^v \parallel q-1$ implies that $p^v \parallel \log (q)$, the cokernels $\displaystyle {\operatorname{cok}} (M + \frac{1}{2} \log (q)I)$ and ${\operatorname{cok}}(M+p^v I)$ have the same distribution.


Now it is natural to define the linearization of ${\operatorname{cok}}(F-I)$ ($F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$) by ${\operatorname{cok}}(M+p^v I)$ ($M \in \mathfrak{sp}_{2g}(\mathbb{Z}_p)$). 
By an indirect argument using the moments, Lipnowski, Sawin and Tsimerman proved that ${\operatorname{cok}}(F-I)$ for a random $F \in \operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ and ${\operatorname{cok}}(M+p^vI)$ for a random $M \in \mathfrak{sp}_{2g}(\mathbb{Z}_p)$ have the same distribution.
If we replace $\operatorname{GSp}_{2g}^{(q)}(\mathbb{Z}_p)$ with $\operatorname{GL}_n(\mathbb{Z}_p)$, the linearization of ${\operatorname{cok}}(A-I)$ ($A \in \operatorname{GL}_n(\mathbb{Z}_p)$) is given by ${\operatorname{cok}}(M)$ ($M \in \operatorname{M}_n(\mathbb{Z}_p)$). These two cokernels have the same distribution by the formula (\ref{eq1b}).


One may think that the cokernels ${\operatorname{cok}}(\log(F))$ and ${\operatorname{cok}}(F-I)$ have the same distribution because $F-I$ is a good enough approximation of $\log(F)$. In this perspective, the cokernels ${\operatorname{cok}} (P_1(A)), \, {\operatorname{cok}}(P_2(A)), \cdots$ should have the same distribution for
$$
P_m(x) = (x-1)Q_m(x) := (x-1) \sum_{k=1}^{m} \frac{(-1)^{k-1}}{k}(x-1)^{k-1}.
$$
It seems reasonable because $F \equiv I \;\; (\text{mod } p)$ implies that the cokernels ${\operatorname{cok}} (P_1(A)), \, {\operatorname{cok}}(P_2(A)), \cdots$ are the same. However, the following example tells us that this is not true. 

\begin{example} \label{ex31a}
Let $p>3$ be a prime and $A \in \operatorname{GL}_n(\mathbb{Z}_p)$ be a random matrix. 
Since the polynomials $t, t-1, t-3 \in \mathbb{F}_p[t]$ are distinct and irreducible, we have
\begin{equation*}
\begin{split}
& \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\left ( {\operatorname{cok}}  ( P_2(A) ) = 0 \right ) \\
= &  \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
({\operatorname{cok}}(A-I_n) = {\operatorname{cok}}(A-3I_n) = 0) \\
= & \prod_{i=1}^{\infty} (1-p^{-i}) \cdot \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\left ( {\operatorname{cok}}  ( P_1(A) ) = 0 \right )
\end{split}
\end{equation*}
by Theorem \ref{mainthm1}. (Here we have used the fact that ${\operatorname{cok}} (A) =0$ if and only if $A \in \operatorname{GL}_n(\mathbb{Z}_p)$.) Therefore the distributions of ${\operatorname{cok}}(P_2(A))$ and ${\operatorname{cok}}(P_1(A))$ do not coincide.
\end{example}

Let $\ell$ be a prime. By Eisenstein's criterion, $\ell ! \, Q_{\ell}(x+1) \in \mathbb{Z}[x]$ is irreducible over $\mathbb{Q}$ so $Q_{\ell}(x)$ is also irreducible over $\mathbb{Q}$. 
Assume that there exists a prime $p = p_{\ell} > \max (\ell, 3)$ such that $\overline{Q_{\ell}}(x) \in \mathbb{F}_p[x]$ (reduction modulo $p$ of $Q_{\ell}(x) \in \mathbb{Z}_p[x]$) is irreducible. 
The local-global principle does not hold in general for degree $\geq 3$ so the irreducibility of $Q_{\ell}(x)$ does not guarantee the existence of such $p$. 
Let $H$ be any finite abelian $p$-group whose order is smaller than $p^{\ell-1}$.


For $A \in \operatorname{GL}_n(\mathbb{Z}_p)$, we have ${\operatorname{cok}}(P_{\ell}(A)) \cong {\operatorname{cok}}(A-I) \times {\operatorname{cok}}( Q_{\ell}(A))$. Since $\overline{Q_{\ell}}(x) \in \mathbb{F}_p[x]$ is irreducible, ${\operatorname{cok}}(Q_{\ell}(A))$ has an $R_{\ell} := \mathbb{Z}_p[t]/(Q_{\ell}(t))$-module structure. 
The ring $R_{\ell}$ is a complete discrete valuation ring with a finite residue field $\mathbb{F}_p[t]/(\overline{Q_{\ell}}(t)) \cong \mathbb{F}_{p^{\ell-1}}$. 
Therefore if ${\operatorname{cok}}( Q_{\ell}(A))$ is nonzero, then it should have at least $p^{\ell-1}$ elements. By the condition $\left | H \right | < p^{\ell-1}$, we have
\begin{equation*}
 {\operatorname{cok}}(P_{\ell}(A)) \cong H \; \Leftrightarrow \; {\operatorname{cok}}(A-I) \cong H \text{ and } {\operatorname{cok}}(Q_{\ell}(A))=0.   
\end{equation*}
The polynomials $t, t-1, \ell (-1)^{\ell - 1}\overline{Q_{\ell}}(t) \in \mathbb{F}_{p_{\ell}}[t]$ are monic, distinct and irreducible so
\begin{equation*}
\begin{split}
& \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_{p_{\ell}})}{\operatorname{Prob}}
({\operatorname{cok}}(P_{\ell}(A)) \cong H) \\
= & \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_{p_{\ell}})}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A-I) \cong H \text{ and } \\ 
{\operatorname{cok}}(Q_{\ell}(A))=0
\end{pmatrix} \\
= & \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_{p_{\ell}})}{\operatorname{Prob}}
({\operatorname{cok}}(A-I) \cong H) \times \prod_{i=1}^{\infty} (1-p_{\ell}^{-i (\ell -1)})
\end{split}    
\end{equation*}
by Theorem \ref{mainthm1}. 
Taking the limit $\ell \rightarrow \infty$, we obtain
\begin{equation} \label{eq31a}
\lim_{\ell \rightarrow \infty} \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_{p_{\ell}})}{\operatorname{Prob}} ({\operatorname{cok}}(P_{\ell}(A)) \cong H)    
= \lim_{\ell \rightarrow \infty} \lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_{p_{\ell}})}{\operatorname{Prob}}
({\operatorname{cok}}(A-I) \cong H).
\end{equation}

This result supports the relation between ${\operatorname{cok}}(A-I)$ and its linearization, i.e. ${\operatorname{cok}}(\log A)$ for a random matrix $A$. Although our argument does not give a precise relation between a non-linear random matrix model and its linearization, we hope that it provides some insights on the linearization. 

\subsection{A conjectural generalization of Theorem \ref{mainthm1}} \label{Sub32}

The distinction between the reductions modulo $p$ of the polynomials $P_1(t), \cdots, P_l(t)$ in Theorem \ref{mainthm1} is essential. 
If two monic polynomials $P_1(t), P_2(t) \in \mathbb{Z}_p[t]$ have the same reduction modulo $p$, then ${\operatorname{cok}}(P_1(A))$ and ${\operatorname{cok}}(P_2(A))$ have the same $p$-rank so they can never be independent. Even in the simplest case $P_1(t)=t$ and $P_2(t)=t-p^v$ ($v>0$), it is not clear for us how to compute the joint distribution of ${\operatorname{cok}}(P_1(A))$ and ${\operatorname{cok}}(P_2(A))$. 

\begin{example} \label{ex32a}
Consider the joint distribution of ${\operatorname{cok}}(A-I)$ and ${\operatorname{cok}}(A-(p^v+1)I)$ for a random matrix $A \in \operatorname{GL}_n(\mathbb{Z}_p)$ and a positive integer $v$. If $A \equiv I \;\; (\text{mod } p)$, then
$$
{\operatorname{cok}}(A-I) \cong {\operatorname{cok}}(\log A)
$$
and
\begin{equation*}
\begin{split}
{\operatorname{cok}}(A-(p^v+1)I) 
& \cong {\operatorname{cok}}(\frac{A}{p^v+1}-I) \\
& \cong {\operatorname{cok}}(\log A - \log((p^v+1)I)) \\
& = {\operatorname{cok}}(\log A - \log(p^v+1)I).
\end{split}    
\end{equation*}
Since $p^v \parallel \log(p^v+1)$, the joint distribution of ${\operatorname{cok}}(M)$ and ${\operatorname{cok}}(M - \log(p^v+1)I)$ for a random $M \in \operatorname{M}_n(\mathbb{Z}_p)$ is same as the joint distribution of ${\operatorname{cok}}(M)$ and ${\operatorname{cok}}(M-p^vI)$. Following the idea of linearization, we expect that for every finite abelian $p$-groups $H_1$ and $H_2$ with $r_p(H_1)=r_p(H_2)$, the distribution of ${\operatorname{cok}}(A)=0$ and the joint distribution of ${\operatorname{cok}}(A-I) \cong H_1$ and ${\operatorname{cok}}(A-(p^v+1)I) \cong H_2$ become independent as $n \rightarrow \infty$, i.e.
$$
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{GL}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(A-I) \cong H_1 \text{ and } \\ 
{\operatorname{cok}}(A-(p^v+1)I) \cong H_2
\end{pmatrix} 
= \lim_{n \rightarrow \infty} \underset{M \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(M) \cong H_1 \text{ and } \\ 
{\operatorname{cok}}(M-p^vI) \cong H_2
\end{pmatrix}. 
$$
\end{example}

Let $Q_1(t), \cdots, Q_l(t) \in \mathbb{F}_p[t]$ be distinct monic irreducible polynomials and $P_{ij}(t) \in \mathbb{Z}_p[t]$ ($1 \leq j \leq k_i$) be distinct monic polynomials whose reductions modulo $p$ are $Q_i(t)$ for each $1 \leq i \leq l$. For each $i$, let $J_i$ be the joint distribution of the cokernels ${\operatorname{cok}}(P_{ij}(A))$ ($1 \leq j \leq k_i$). Motivated by the above example, we claim that the distributions $J_1, \cdots, J_l$ become independent as $n \rightarrow \infty$. When $k_i=1$ for all $i$, the following conjecture is a consequence of Theorem \ref{mainthm1}.

\begin{conjecture} \label{conj32b}
Let $H_{ij}$ be a finite module over $R_{ij} := \mathbb{Z}_p[t]/(P_{ij}(t))$ for each $i$ and $j$ such that $r_p(H_{ij}) = r_p(H_{ij'})$ for every $1 \leq i \leq l$ and $1 \leq j, j' \leq k_i$. Then we have
\begin{equation} \label{eq32b}
\lim_{n \rightarrow \infty} \left| \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_{ij}(A)) \cong H_{ij} \text{ for} \\ 
1 \leq i \leq l, \, 1 \leq j \leq k_i
\end{pmatrix} 
- \prod_{i=1}^{l} \left ( \underset{A_i \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_{ij}(A_i)) \cong H_{ij} \\ 
\text{ for } 1 \leq j \leq k_i
\end{pmatrix} \right ) \right| = 0.
\end{equation}
In particular, if we assume that the limit
$$
\lim_{n \rightarrow \infty} \underset{A_i \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_{ij}(A_i)) \cong H_{ij} \\ 
\text{ for } 1 \leq j \leq k_i
\end{pmatrix}
$$
converges for each $1 \leq i \leq l$, then we have
\begin{equation} \label{eq32c}
\lim_{n \rightarrow \infty}  \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_{ij}(A)) \cong H_{ij} \text{ for} \\ 
1 \leq i \leq l, \, 1 \leq j \leq k_i
\end{pmatrix} 
= \prod_{i=1}^{l} \left ( \lim_{n \rightarrow \infty} \underset{A_i \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} \begin{pmatrix}
{\operatorname{cok}}(P_{ij}(A_i)) \cong H_{ij} \\ 
\text{ for } 1 \leq j \leq k_i
\end{pmatrix} \right ).
\end{equation}
\end{conjecture}





\section{Independence phenomenon} \label{Sec4}

A special case of Theorem \ref{mainthm1} says that the distributions of ${\operatorname{cok}} (A)$ and ${\operatorname{cok}} (A+I_n)$ for a random $A \in \operatorname{M}_n(\mathbb{Z}_p)$ become independent as $n \rightarrow \infty$. It is natural to ask whether such independence phenomenon holds for the distributions of ${\operatorname{cok}} (A)$ and ${\operatorname{cok}} (A+B_n)$, where $\left \{ B_n \right \}_{n \geq 1}$ is a given sequence of matrices such that $B_n \in \operatorname{M}_n(\mathbb{Z}_p)$. 
In this section, we prove the following theorem that gives an answer to the question.

\begin{theorem} \label{mainthm2}
Let $\left \{ B_n \right \}_{n \geq 1}$ be any sequence of matrices such that $B_n \in \operatorname{M}_n(\mathbb{Z}_p)$ and
\begin{equation} \label{eq4b}
\lim_{n \rightarrow \infty} (n - \log_p n - r_p({\operatorname{cok}}(B_n)) ) = \infty.
\end{equation}
Then for every finite abelian $p$-groups $H_1$ and $H_2$, we have
\begin{equation} \label{eq4a}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) \cong H_1 \text{ and } \\ 
{\operatorname{cok}}(A+B_n) \cong H_2
\end{pmatrix} = \prod_{j=1}^{2} \left ( \frac{1}{\left | \operatorname{Aut}_{\mathbb{Z}_p}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i}) \right ).
\end{equation}
\end{theorem}

For given $H_1$ and $H_2$, the following notations will be used throughout this section. 
\begin{itemize}
    \item For $j \in \left\{ 1, 2 \right\}$, $\displaystyle c(H_j) :=  \frac{1}{\left | \operatorname{Aut}_{\mathbb{Z}_p}(H_j) \right |} \prod_{i=1}^{\infty}(1-p^{-i})$.
    
    \item For a given sequence $\left \{ B_n \right \}_{n \geq 1}$, denote
    $r_n  := r_p({\operatorname{cok}}(B_n))$.
    
    \item For $n>2r>0$, let $\widetilde{\operatorname{M}}_{n, r}(\mathbb{Z}_p) \subset \operatorname{M}_n(\mathbb{Z}_p)$ be as in Section \ref{Sub22}. For $n>r>0$, denote
$$
\operatorname{M}^{1}_{n, r}(\mathbb{Z}_p) := \left \{ \begin{pmatrix}
A_1 & A_2 \\ 
A_3 & A_4
\end{pmatrix} \in \operatorname{M}_{r+(n-r)}(\mathbb{Z}_p) : (A_3)_{*1} = \begin{pmatrix}
1 & 0 & \cdots & 0
\end{pmatrix}^T \right \} \subset \operatorname{M}_n(\mathbb{Z}_p).
$$   

    \item For $n > r \geq 0$ and $X \in \operatorname{M}_{r}(\mathbb{Z}_p)$, denote
\begin{equation*}
\begin{split}
P_{n, r}(X) & := \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}} ({\operatorname{cok}} (A) \cong H_1 \text{ and } {\operatorname{cok}} \left (A + \begin{pmatrix}
X & O \\ 
O & I_{n-r}
\end{pmatrix} \right ) \cong H_2), \\
P_{n, r}^{+} & := \underset{X \in \operatorname{M}_r(\mathbb{Z}_p)}{\sup} P_{n, r}(X), \\
P_{n, r}^{-} & := \underset{X \in \operatorname{M}_r(\mathbb{Z}_p)}{\inf} P_{n, r}(X).
\end{split}
\end{equation*}
    
    \item $\widetilde{P}_{n, r}(X)$, $P^{1}_{n, r}(X)$, $\widetilde{P}^{\pm}_{n,r}$ and $P^{1, \pm}_{n,r}$ are defined by the same way.
\end{itemize}

First we prove the following proposition, which is a weaker version of Theorem \ref{mainthm2}.

\begin{proposition} \label{prop42}
The equation (\ref{eq4a}) holds for every $H_1$ and $H_2$ if
\begin{equation} \label{eq4c}
\lim_{n \rightarrow \infty} (n - 2 r_n ) = \infty.
\end{equation}
\end{proposition}

\begin{proof}
Fix $H_1$ and $H_2$. For $n > 2r > 0$ and $X \in \operatorname{M}_{r}(\mathbb{Z}_p)$, we obtain
\begin{equation} \label{eq4d}
\left| P_{n, r}(X) - \widetilde{P}_{n, r}(X) \right| \leq 1 - c_{n-r, r}
\end{equation}
by applying Lemma \ref{lem21b} as before. Now consider the probability $\widetilde{P}_{n, r}(X)$. Let
$$
A = \begin{pmatrix}
A_1 & A_2 & A_3 \\ 
I_r & A_4 & A_5 \\ 
O & A_6 & A_7 
\end{pmatrix} \in \widetilde{\operatorname{M}}_{n, r}(\mathbb{Z}_p)
$$
and 
$$
B = \begin{pmatrix}
X & O \\
O & I_{n-r}
\end{pmatrix} \in \operatorname{M}_{r+(n-r)}(\mathbb{Z}_p).
$$
By elementary operations, we can simultaneously transform $A$ and $B$ as follows:
\begin{equation*}
\small
\begin{split}
& \, (A, B) \\
\Rightarrow & \left ( \begin{pmatrix}
O & A_2-A_1A_4 & A_3-A_1A_5 \\ 
I_r & A_4 & A_5 \\ 
O & A_6 & A_7
\end{pmatrix}, \, \begin{pmatrix}
X & -A_1 & O \\ 
O & I_r & O \\ 
O & O & I_{n-2r}
\end{pmatrix} \right ) \\
\Rightarrow & \left ( \begin{pmatrix}
O & A_2-A_1A_4 & A_3-A_1A_5 \\ 
I_r & O & O \\ 
O & A_6 & A_7
\end{pmatrix}, \, \begin{pmatrix}
X & -A_1-XA_4 & -XA_5 \\ 
O & I_r & O \\ 
O & O & I_{n-2r}
\end{pmatrix} \right ) \\
\Rightarrow & \left ( \begin{pmatrix}
O & A_2' = A_2-A_1A_4+XA_5A_6 & A_3'= A_3-A_1A_5+XA_5A_7 \\ 
I_r & O & O \\ 
O & A_6 & A_7
\end{pmatrix}, \, \begin{pmatrix}
X & -A_1' = -A_1-XA_4 & O \\ 
O & I_r & O \\ 
O & O & I_{n-2r}
\end{pmatrix} \right ) \\
=: & \, (A', B').
\end{split}
\end{equation*}
Now we have
$$
{\operatorname{cok}}(A) \cong {\operatorname{cok}} (A') \cong {\operatorname{cok}} \begin{pmatrix}
A_2' & A_3' \\
A_6 & A_7 \\
\end{pmatrix}
$$
and
\begin{equation*}
\begin{split}
{\operatorname{cok}}(A+B) & \cong {\operatorname{cok}}(A'+B') \\
& \cong {\operatorname{cok}} \begin{pmatrix}
X & A_2'-A_1' & A_3' \\ 
I_r & I_r & O \\ 
O & A_6 & A_7+I_{n-2r}
\end{pmatrix} \\
& \cong {\operatorname{cok}} \begin{pmatrix}
O & A_2'-A_1'-X & A_3' \\ 
I_r & I_r & O \\ 
O & A_6 & A_7+I_{n-2r}
\end{pmatrix} \\
& \cong {\operatorname{cok}} \left ( \begin{pmatrix}
A_2' & A_3' \\
A_6 & A_7 \\
\end{pmatrix} + \begin{pmatrix}
-A_1'' = -A_1'-X & O \\
O & I_{n-2r} \\
\end{pmatrix}  \right ).
\end{split}    
\end{equation*}
For given $A_i$ ($4 \leq i \leq 7$) and $X$, the matrices $A_1''$, $A_2'$, $A_3'$ are random if $A_i$ ($1 \leq i \leq 3$) are random. Therefore $\widetilde{P}_{n, r}(X)$ is independent of the choice of $X$ so the equation (\ref{eq4d}) implies that
\begin{equation} \label{eq4e}
\left| P_{n, r}(X) - P_{n, r}(I_r) \right| \leq 2(1 - c_{n-r, r})
\end{equation}
for every $X \in \operatorname{M}_r(\mathbb{Z}_p)$. 

Now consider a sequence $\left \{ B_n \right \}_{n \geq 1}$ which satisfies the condition (\ref{eq4c}). The Smith normal form of $B_n$ is of the form $\displaystyle \begin{pmatrix}
X_{n} & O\\ 
O & I_{n-r_n}
\end{pmatrix}$ for some $X_n \in \operatorname{M}_{r_n}(\mathbb{Z}_p)$. 
The equation (\ref{eq4e}) implies that
$$
\left | P_{n, r_n}(X_n) - P_{n, r_n}(I_{r_n}) \right | \leq 2(1-c_{n-r_n, r_n})
$$
when $n>2r_n$. The assumption $\displaystyle \lim_{n \rightarrow \infty} (n- 2r_n) = \infty$ implies that
$$
\lim_{n \rightarrow \infty} 2(1-c_{n-r_n, r_n})=0.
$$
Therefore 
$$
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) \cong H_1 \text{ and } \\ 
{\operatorname{cok}}(A+B_n) \cong H_2
\end{pmatrix}
= \lim_{n \rightarrow \infty} P_{n, r_n}(X_n)
= \lim_{n \rightarrow \infty} P_{n, r_n}(I_{r_n})
= c(H_1)c(H_2),
$$
where the last equality follows from Theorem \ref{mainthm1}.
\end{proof}

The Smith normal form of each $B_n$ tells us that Theorem \ref{mainthm2} is true if the equation
\begin{equation*}
\lim_{n \rightarrow \infty} P_{n, r_n}^+
= \lim_{n \rightarrow \infty} P_{n, r_n}^-
= c(H_1)c(H_2)
\end{equation*}
holds whenever the condition (\ref{eq4b}) is satisfied. The next proposition provides a relation between $P_{n, r}^{\pm}$ and $P_{n-1, r-1}^{\pm}$.

\begin{proposition} \label{prop43}
For $n>r \geq 1$, we have
\begin{equation} \label{eq4f}
P_{n-1, r-1}^{-} - d_{n, r}
\leq P_{n,r}^{-} 
\leq P_{n, r}^{+} 
\leq P_{n-1, r-1}^{+} + d_{n, r}
\end{equation}
for $\displaystyle d_{n,r} := (1-c_{n-r, 1}) + (1 - c_{r,1} ) = \frac{1}{p^{n-r}} + \frac{1}{p^r}$.
\end{proposition}

\begin{proof}
Consider $A = \begin{pmatrix}
A_1 & A_2\\ 
A_3 & A_4
\end{pmatrix} \in \operatorname{M}_{r+(n-r)}(\mathbb{Z}_p)$. Applying Lemma \ref{lem21b} to the first column of $A_3$, we have
\begin{equation} \label{eq4g}
P_{n, r}^{+} \leq P_{n, r}^{1, +} + (1 - c_{n-r, 1}).
\end{equation}
Let 
$$
A = \begin{pmatrix}
A_1 & A_2 & A_3 & A_4\\ 
1 & A_5 & A_6 & A_7\\ 
O & A_8 & A_9 & A_{10}
\end{pmatrix} \in \operatorname{M}^{1}_{n, r}(\mathbb{Z}_p) \subset \operatorname{M}_{(r+1+(n-r-1)) \times (1+(r-1)+1+(n-r-1))}(\mathbb{Z}_p)
$$ 
and 
$$
X = \begin{pmatrix}
X_1 & X_2
\end{pmatrix} \in \operatorname{M}_{r \times (1+(r-1))}(\mathbb{Z}_p).
$$ 
By elementary operations, we can simultaneously transform $A$ and $\displaystyle \begin{pmatrix}
X & O \\ 
O & I_{n-r}
\end{pmatrix}$ as follows:
\begin{equation*}
\small
\begin{split}
& \, (A, \begin{pmatrix}
X & O \\ 
O & I_{n-r}
\end{pmatrix}) \\
\Rightarrow & \, \left ( \begin{pmatrix}
O & A_2' & A_3' & A_4'\\ 
1 & A_5 & A_6 & A_7\\ 
O & A_8 & A_9 & A_{10}
\end{pmatrix}, 
\begin{pmatrix}
X_1 & X_2 & -A_1 & O\\ 
O & O & 1 & O\\ 
O & O & O & I_{n-r-1}
\end{pmatrix}
 \right ) \\
\Rightarrow & \, \left ( \begin{pmatrix}
O & A_2' & A_3' & A_4'\\ 
1 & O & O & O\\ 
O & A_8 & A_9 & A_{10}
\end{pmatrix}, 
\begin{pmatrix}
X_1 & X_2-X_1A_5 & -A_1' & -X_1A_7\\ 
O & O & 1 & O\\ 
O & O & O & I_{n-r-1}
\end{pmatrix}
 \right ) \\
\Rightarrow & \, \left ( \begin{pmatrix}
O & A_2'' & A_3'' & A_4''\\ 
1 & O & O & O\\ 
O & A_8 & A_9 & A_{10}
\end{pmatrix}, 
\begin{pmatrix}
X_1 & X_2-X_1A_5 & -A_1' & O\\ 
O & O & 1 & O\\ 
O & O & O & I_{n-r-1}
\end{pmatrix}
 \right ).
\end{split}
\end{equation*}
Now we have
$$
{\operatorname{cok}} (A) \cong {\operatorname{cok}} \left ( A' := \begin{pmatrix}
A_2'' & A_3'' & A_4'' \\ 
A_8 & A_9 & A_{10}
\end{pmatrix} \right ) 
$$
and

\begin{equation*}
\small
\begin{split}
{\operatorname{cok}} \left ( A + \begin{pmatrix}
X & O \\ 
O & I_{n-r}
\end{pmatrix} \right )  
& \cong {\operatorname{cok}} \begin{pmatrix}
X_1 & A_2''+X_2-X_1A_5 & A_3''-A_1' & A_4''\\ 
1 & O & 1 & O\\ 
O & A_8 & A_9 & A_{10}+I_{n-r-1}
\end{pmatrix} \\
& \cong {\operatorname{cok}} \begin{pmatrix}
O & A_2''+X_2-X_1A_5 & A_3''+A_1'' & A_4''\\ 
1 & O & 1 & O\\ 
O & A_8 & A_9 & A_{10}+I_{n-r-1}
\end{pmatrix} \\
& \cong {\operatorname{cok}} \begin{pmatrix}
A_2''+X_2-X_1A_5 & A_3''+A_1'' & A_4''\\ 
A_8 & A_9 & A_{10}+I_{n-r-1}
\end{pmatrix} \\
& = {\operatorname{cok}} \left ( A' + \begin{pmatrix}
X_2-X_1A_5 & A_1'' & O\\ 
O & O & I_{n-r-1}
\end{pmatrix} \right ).
\end{split}    
\end{equation*}
For given $X$ and $A_i$ ($5 \leq i \leq 10$), $A_j''$ ($1 \leq j \leq 4$) are random if $A_j$ ($1 \leq j \leq 4$) are random. Therefore $A'$, $A_1''$ and $A_5$ are random and independent if $A$ is random.

Now define
\begin{equation*}
\begin{split}
P_{n-1, r}^{2}(X) & := \underset{\substack{A' \in \operatorname{M}_{n-1}(\mathbb{Z}_p) \\ A_1'' \in \operatorname{M}_{r \times 1}(\mathbb{Z}_p)}}{\operatorname{Prob}} ({\operatorname{cok}} (A') \cong H_1 \text{ and } {\operatorname{cok}} \left (A' + \begin{pmatrix}
X & A_1'' & O \\ 
O & O & I_{n-r-1}
\end{pmatrix} \right ) \cong H_2), \\
P_{n-1, r}^{3}(X) & := \underset{A' \in \operatorname{M}_{n-1}(\mathbb{Z}_p)}{\operatorname{Prob}} ({\operatorname{cok}} (A') \cong H_1 \text{ and } {\operatorname{cok}} \left (A' + \begin{pmatrix}
X & e_r & O \\ 
O & O & I_{n-r-1}
\end{pmatrix} \right ) \cong H_2)
\end{split}    
\end{equation*}
for $X \in \operatorname{M}_{r \times (r-1)}(\mathbb{Z}_p)$, $e_r := \begin{pmatrix}
0 & \cdots & 0 & 1
\end{pmatrix}^T \in \operatorname{M}_{r \times 1} (\mathbb{Z}_p)$ and 
$$
P_{n-1,r}^{i, +} := \underset{X \in \operatorname{M}_{r \times (r-1)}(\mathbb{Z}_p)}{\sup} P_{n-1, r}^{i}(X)
$$
for $i \in \left\{ 2, 3 \right\}$. Then we have the followings.
\begin{itemize}
    \item The above reduction implies that $P_{n,r}^{1}(X) \leq P_{n-1,r}^{2, +}$ for every $X \in \operatorname{M}_{r \times (r-1)}(\mathbb{Z}_p)$ so
\begin{equation} \label{eq4h}
P_{n,r}^{1, +} \leq P_{n-1,r}^{2, +}.
\end{equation}

    \item By applying Lemma \ref{lem21b} to $A_1''$, we have $P_{n-1,r}^{2}(X) \leq P_{n-1,r}^{3, +} + (1 - c_{r, 1})$ for every $X$ so
\begin{equation} \label{eq4i}
P_{n-1,r}^{2, +} \leq P_{n-1,r}^{3, +} + (1 - c_{r, 1}).
\end{equation}
    
    \item The equality
\begin{equation} \label{eq4j}
P_{n-1,r}^{3, +} = P_{n-1, r-1}^{+}
\end{equation}
is clear from the definitions of $P_{n-1, r}^{3, +}$ and $P_{n-1, r-1}^{+}$.
\end{itemize}
By the equations (\ref{eq4g}), (\ref{eq4h}), (\ref{eq4i}) and (\ref{eq4j}), we have
\begin{equation*}
P_{n, r}^{+} \leq P_{n-1, r-1}^{+} + d_{n,r}.
\end{equation*}
The proof of the inequality $P_{n-1, r-1}^{-} - d_{n, r}
\leq P_{n,r}^{-}$ is exactly the same.
\end{proof}

Now we prove the main result of this section.

\vspace{3mm}

\noindent \textit{Proof of Theorem \ref{mainthm2}.} Proposition \ref{prop42} implies that the formula (\ref{eq4a}) holds whenever 
$$
\lim_{n \rightarrow \infty} (n - 2r_n) = \infty.
$$
Therefore we may assume that $\displaystyle r_n \geq  \frac{2n}{5}$ for every $n \geq 1$. For $\displaystyle y_n := \left \lfloor \frac{3r_n-n}{2} \right \rfloor \geq \left \lfloor \frac{n}{10} \right \rfloor$, we have
\begin{equation} \label{eq4k}
\begin{split}
P_{n, r_n}^{+} 
& \leq P_{n-y_n, r_n-y_n}^{+} + \sum_{i=0}^{y_n-1} d_{n-i, r_n-i} \\
& \leq P_{n-y_n, r_n-y_n}^{+} + \frac{y_n}{p^{n-r_n}} + \frac{2}{p^{r_n-y_n+1}} \\
& \leq P_{n-y_n, r_n-y_n}^{+} + \frac{n}{p^{n-r_n}} + \frac{2}{p^{\frac{n-r_n}{2}}}
\end{split}    
\end{equation}
by Proposition \ref{prop43}. Now we have the followings. 
\begin{itemize}
    \item The condition (\ref{eq4b}) implies that
\begin{equation} \label{eq4l}
\lim_{n \rightarrow \infty} \left ( \frac{n}{p^{n-r_n}} + \frac{2}{p^{\frac{n-r_n}{2}}} \right ) = 0.
\end{equation}

\item $\displaystyle (n-y_n)-2(r_n-y_n) \geq \frac{n-r_n-1}{2}$ so Proposition \ref{prop42} implies that
\begin{equation} \label{eq4m}
\lim_{n \rightarrow \infty} P_{n-y_n, r_n-y_n}^{+} = c(H_1)c(H_2).
\end{equation}
\end{itemize}
By the equations (\ref{eq4k}), (\ref{eq4l}) and (\ref{eq4m}), we have
$$
\limsup_{n \rightarrow \infty} P_{n, r_n}^{+} 
\leq \limsup_{n \rightarrow \infty} P_{n-y_n, r_n-y_n}^{+}
= c(H_1)c(H_2).
$$
The inequailty $\displaystyle \liminf_{n \rightarrow \infty} P_{n, r_n}^{-} \geq c(H_1)c(H_2)$ can be deduced by the same argument. $\square$ \\

We expect that the condition (\ref{eq4b}) of Theorem \ref{mainthm2} can be strengthened to $\displaystyle \lim_{n \rightarrow \infty} (n - r_n) = \infty$. Although we did not prove this, we prove its converse: the formula (\ref{eq4a}) does not hold if $n-r_n$ does not go to infinity as $n \rightarrow \infty$. Denote $\displaystyle \alpha_{p, k} := \prod_{i=1}^{k} (1-p^{-i})$ and $\displaystyle \alpha_{p, \infty} := \prod_{i=1}^{\infty} (1-p^{-i})$.

\begin{lemma} \label{lem44}
Fix $k \geq 0$ and denote $\displaystyle I_{n, k}  := \begin{pmatrix}
I_k & O\\ 
O & O
\end{pmatrix} \in \operatorname{M}_{k+(n-k)}(\mathbb{Z}_p)$ for $n \geq k$. Then
\begin{equation*}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) = 0 \text{ and } \\ 
{\operatorname{cok}}(A+I_{n, k}) = 0
\end{pmatrix} 
= \alpha_{p, \infty} \alpha_{p, k}.
\end{equation*}
\end{lemma}

\begin{proof}
Define
\begin{equation*}
 P_{n, k}  
:= \underset{A \in \operatorname{M}_{n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) = 0 \text{ and } \\ 
{\operatorname{cok}}(A+I_{n, k}) = 0
\end{pmatrix} 
= \underset{A \in \operatorname{M}_{n}(\mathbb{F}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) = 0 \text{ and } \\ 
{\operatorname{cok}}(A+\overline{I_{n, k}}) = 0
\end{pmatrix}
\end{equation*}
and
$$
P'_{n, k} 
:= \lim_{n \rightarrow \infty} \underset{\substack{A_1, A_2 \in \operatorname{M}_{n \times k}(\mathbb{F}_p) \\ C \in \operatorname{M}_{n \times (n-k)}(\mathbb{F}_p)}}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}} \left(\begin{array}{@{}c|c@{}}
    A_1 & C \\
  \end{array}\right) = 0 \text{ and } \\ 
{\operatorname{cok}} \left(\begin{array}{@{}c|c@{}}
    A_1+A_2 & C \\
  \end{array}\right) = 0
\end{pmatrix}.
$$
Then Lemma \ref{lem21b} (applied to $A_2$) implies that
$$
\left| P_{n, k} - P'_{n, k} \right| \leq 1-c_{n, k}.
$$
A matrix $\begin{pmatrix}
A_1 & C
\end{pmatrix} \in \operatorname{M}_{n \times (k+(n-k))}(\mathbb{F}_p)$ has a trivial cokernel if and only if $\operatorname{rank} (C) = n-k$ and the columns of $A_1$ give an $\mathbb{F}_p$-basis of $\mathbb{F}_p^n/C \mathbb{F}_p^{n-k} \cong \mathbb{F}_p^k$. 
For a random $A_1 \in \operatorname{M}_{n \times k}(\mathbb{F}_p)$, the images of its columns in $\mathbb{F}_p^n/C \mathbb{F}_p^{n-k}$ are also random. 
Therefore
\begin{equation*}
\begin{split}
P'_{n, k} & = \underset{C \in \operatorname{M}_{n \times (n-k)}(\mathbb{F}_p)}{\operatorname{Prob}} (\operatorname{rank} (C) = n-k) \times \left ( \frac{\left |\operatorname{GL}_k(\mathbb{F}_p)  \right |}{\left |\operatorname{M}_k(\mathbb{F}_p)  \right |} \right )^2 \\
& = \frac{\alpha_{p, n}}{\alpha_{p, k}} \alpha_{p, k}^2 \\
& = \alpha_{p, n} \alpha_{p, k}
\end{split}
\end{equation*}
so
$$
\lim_{n \rightarrow \infty} P_{n, k}
= \lim_{n \rightarrow \infty} P'_{n, k}
= \alpha_{p, \infty} \alpha_{p, k}.
$$
\end{proof}

\begin{proposition} \label{prop45}
If the formula (\ref{eq4a}) holds for $H_1=H_2=0$, then $\displaystyle \lim_{n \rightarrow \infty} (n - r_n) = \infty$.
\end{proposition}

\begin{proof}
Assume that the condition $\displaystyle \lim_{n \rightarrow \infty} (n - r_n) = \infty$ does not hold. Choose an integer $k \geq 0$ and a subsequence $\left \{ B_{w_n} \right \}$ of $\left \{ B_{n} \right \}$ such that 
$$
w_n - r_p({\operatorname{cok}}(B_{w_n})) = k
$$
for every $n \geq 1$. The Smith normal form of $\overline{B_{w_n}} \in \operatorname{M}_{w_n}(\mathbb{F}_p)$ is $\overline{I_{w_n, k}} \in \operatorname{M}_{k+(w_n-k)}(\mathbb{F}_p)$ so
\begin{equation*}
\begin{split}
\lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{w_n}(\mathbb{Z}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) =0 \text{ and } \\ 
{\operatorname{cok}}(A+B_{w_n}) = 0
\end{pmatrix}  & = \lim_{n \rightarrow \infty} \underset{A \in \operatorname{M}_{w_n}(\mathbb{F}_p)}{\operatorname{Prob}}
\begin{pmatrix}
{\operatorname{cok}}(A) =0 \text{ and } \\ 
{\operatorname{cok}}(A+\overline{I_{w_n, k}}) = 0 
\end{pmatrix} \\
& = \alpha_{p, \infty} \alpha_{p, k} \\
& \neq \alpha_{p, \infty}^2
\end{split}    
\end{equation*}
by Lemma \ref{lem44}. 
\end{proof}

\begin{remark} \label{rmk46}
In the proof of the proposition above, $\displaystyle \lim_{k \rightarrow \infty} \alpha_{p, \infty} \alpha_{p, k} = \alpha_{p, \infty}^2$ so the events ${\operatorname{cok}}(A)=0$ and ${\operatorname{cok}}(A+B_n)=0$ for a random $A \in \operatorname{M}_n(\mathbb{Z}_p)$ become independent as $n \rightarrow \infty$ whenever $\displaystyle \lim_{n \rightarrow \infty} (n - r_n) = \infty$. Since we consider the zero cokernels, the distribution does not change after the reduction modulo $p$. However, this argument cannot be applied to the nonzero cokernels. 

For example, a version of Theorem \ref{mainthm1} for a random matrix over $\mathbb{F}_p$ was proved by Boreico \cite[Theorem 3.8.18]{Bor16} (and independently by Cheong and Huang \cite[Theorem 2.10]{CH21}), but it is not easy to lift the distribution over $\mathbb{F}_p$ to the distribution over $\mathbb{Z}_p$. In fact, the main ingredient of the proof of Proposition \ref{prop11} in \cite{CK22} is the counting result for such lifting.
\end{remark}





\section*{Acknowledgments}

The author is supported by a KIAS Individual Grant (MG079601) at Korea Institute for Advanced Study. We thank Gilyoung Cheong for his helpful comments. 

{\small 