\(\(\( (*\ 
      for\ the\ first\ example\ we\ have\ *) \)\(
\)\(\ \)\(\(H = {{1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}};\)

    \(P = {{1, T, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {0, 0, r1, 0, 0, 0}, {0, 
            0, 0, 1, T, 0}, 
{0, 0, 0, 0, 1, 1}, {0, 0, 0, 
            0, 0, r2}};\)

 (*\ 
      construct\ the\ matrix\ M^T\ *) 

    \(MT = 
        Simplify[
          Join[H, H . P, H . P . P, H . P . P . P, H . P . P . P . P, 
            H . P . P . P . P . P]];\)

    MatrixForm[MT]

    \(M = Transpose[MT];\)

    MatrixForm[M]

    MatrixRank[M]\)\)\)

\(\(\( (*\ 
      for\ the\ second\ example\ we\ have\ *) \)\(
\)\(\ \)\(\(H = {{1, 0, 0, 0}, {0, 0, 1, 0}};\)

    \(P = {{1, T, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, T}, 
{0, 
            0, 0, 1}};\)

 (*\ 
      construct\ the\ matrix\ M^T\ *) 

    \(MT = 
        Simplify[
          Join[H, H . P, H . P . P, H . P . P . P]];\)

    MatrixForm[MT]

    \(M = Transpose[MT];\)

    MatrixForm[M]

    MatrixRank[M]\)\)\)