1  Construction

1.1 Code outline

Input:

  • A \((2+k) \times (2 +k)\) matrix \(M\)
  • \(k\)
## random values
set.seed(5)
k <- 3
vals <- rpois((2+k)^2,2)
M <- matrix(vals, nrow = 2+k)
M
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    3    1    1    4
[2,]    3    2    2    1    3
[3,]    4    3    1    4    1
[4,]    1    5    2    2    1
[5,]    0    0    1    3    1
# ## Alex's values
# M <- matrix(c(2,6,3,-5, 1, 
#                           3,1,-3,-5,8,
#                           -4,8,4,4,1,
#                           2,0,6,2,2,
#                           5,4,0,3,2
# ), nrow = 5);M
# k <- nrow(M)-2;k

Step 1

  • Create three new matrices:

    • \(M_{TOP}\) is the \(2 \times (2+k)\) matrix consisting of the first two rows of \(M\)

    • \(M_{BOT}\) is the \(k \times (2+k)\) matrix consisting of the remaining \(k\) rows of \(M\)

    • \(M'\) is the \((2+k) \times (2 +k)\) matrix created by stacking \(M_{TOP}\) and \(-M_{BOT}\)

M_top <- M[1:2,]; M_top
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    3    1    1    4
[2,]    3    2    2    1    3
M_bot <- M[3:(2+k),]; M_bot
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    3    1    4    1
[2,]    1    5    2    2    1
[3,]    0    0    1    3    1
M_prime <- rbind(M_top, -1*M_bot); M_prime
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    3    1    1    4
[2,]    3    2    2    1    3
[3,]   -4   -3   -1   -4   -1
[4,]   -1   -5   -2   -2   -1
[5,]    0    0   -1   -3   -1

Step 2

  • For each \(\sigma \in \binom{[2+k]}{2}\), define \(S_{\sigma}(M)\) as follows:

    The notation is shorthand for the set of all subsets of \(\{1, 2, \dots, n\}\) of size \(k\).

    For example, if \(n = 3\) and \(k=2\), \[\binom{[n]}{k} = \binom{[3]}{2} = \{\{1,2\}, \{1,3\}, \{2,3\}\}\]

    • Start with \(M'\),

      • Consider \(i^{th}\) column for \(i \in \{1, 2, \dots, k+2\}\). If :
        • \(i \in \sigma\): zero out bottom \(k\) entries
        • \(i \not\in \sigma\): zero out the top 2 entries
sig <- combn(2+k, 2)
#n_sig <- .5*k^2 + 1.5*k + 1 
n_sig <- ncol(sig)
S_sig <- replicate(n_sig, M_prime)

for(j in 1:n_sig){
    for(i in 1:(2+k)){
        if(i %in% sig[,j]){
                S_sig[3:(2+k),i,j]<- 0
        }
    else{
                S_sig[1:2,i,j]<- 0
    }
}
}

# ## sig[,7] corresponds to \sigma = \{2,5\}
# S_sig[,,7]
# 
# ## sig[,6] corresponds to \sigma = \{2,4\}
# S_sig[,,6]

Here, \(k = 3\) and \(\sigma = \{2, 5\}\).
  • After this process, you will end up with \(\frac{1}{2}k^2 + \frac{3}{2}k + 1\) matrices

Step 3

Consider the matrices \(\{S_\sigma\}\). Each of these matrices corresponds to a \(2+k\)-dimensional shape (the fundamental parallelepiped \(\Pi \left ( S_\sigma\right )\) defined by the columns of that matrix).

Note that

\[\Pi \left ( S_\sigma\right ) = \{S_\sigma \cdot (x_1, \dots, x_{k+2})'\}\] Think of the \(x_i\) as representing the interval \([0,1]\), so that you are getting a shape. In other words, \(\Pi\) is the Minkowski sum of the columns of \(S_\sigma\).

For each \(\sigma\), want to visualize a collection of parallelepipeds, \(\Pi \left ( S_\sigma\right ) + Mz\), where \(z \in \mathbb{Z}^{k+2}\). (FIXME: in practice we won’t want to generate individual plots because there will be too many, we just want to emphasize a given \(S_\sigma\) in the plots discussed next.)

The desired end product is to create two visualizations: one of all positive \(S_\sigma\) and one of all negative \(S_\sigma\).

The determinant measures volume. So, in this case, the volume of the parallelepiped is 0, so there is nothing to visualize.

S_dets <- apply(S_sig, 3, det)
S_dets == 0
 [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
sum(S_dets>0)
[1] 6

Also, that parallelepiped is more than 3D so there will need to be a choice made in which slices to take for visualization.