A <- matrix(c(1, 2, 3, 1,
2, -1, 1, 0,
1, 2, -1, -2,
1, 3, 2, 1), nrow = 4, byrow = TRUE)
eigen_A <- eigen(A)
kernel <- eigen_A$vectors[, eigen_A$values == 0]
is_injective <- all(eigen_A$values != 0)
print(kernel)
##
## [1,]
## [2,]
## [3,]
## [4,]
cat("\n")
print(paste("Is the transformation injective?", is_injective))
## [1] "Is the transformation injective? TRUE"