[Question]
  [
## Definition
An [arrowhead matrix](https://en.wikipedia.org/wiki/Arrowhead_matrix) is a [matrix](https://en.wikipedia.org/wiki/Matrix_(mathematics)) that has all entries equal to **0**, except the ones on the main diagonal, top row and leftmost column. In other words, the matrix should look like this:
```
* * * * * *
* * 0 0 0 0
* 0 * 0 0 0
* 0 0 * 0 0
* 0 0 0 * 0
* 0 0 0 0 *
```
Where each *\** is any non-zero entry.
## Task
Given a square matrix of non-negative integers, check whether it is arrowhead according to the definition above.
You may *not* take the size of the matrix as input, unless your language’s equivalent to an array is something like a pointer and a length (like C). It will always be at least 3 x 3.
The shortest code [in bytes](https://codegolf.meta.stackexchange.com/questions/10145/how-to-count-bytes-faq) in each language wins.
## Input and Output
You can pick among any of the following formats for receiving input:
* A matrix in the native matrix type (if your language has one)
* A 2D array1 (an array of 1D arrays, each corresponding to one row)
* A 1D array (since the matrix is always square)
* A string (you chose the spacing, but please do not abuse this in any way).
When it comes to providing output, you can either report a [truthy / falsy](https://codegolf.meta.stackexchange.com/q/2190/59487) value following the standard [decision-problem](https://codegolf.stackexchange.com/tags/decision-problem/info) definition, or choose any two distinct and consistent values.
Moreover, you can take input and give output through any [standard method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods), in any [programming language](https://codegolf.meta.stackexchange.com/a/2073/59487), while taking note that [these loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden by default. If want to pick any other format or are unsure about something, please ask in the comments.
1: or your language's equivalent (list, vector, etc.)
## Examples
Let's look at the following examples:
```
1 2 2 2
2 1 0 0
3 0 1 0
4 0 0 1
```
This is an arrowhead matrix (your programs should report a truthy value), because the elements on the main diagonal are `1 1 1 1`, those on the top row are `1 2 2 2` and those on the leftmost column are `1 2 3 4`. All other entries are **0**, so this satisfies all the conditions.
```
3 5 6
7 1 0
8 0 0
```
This matrix is *not* arrowhead because there is a **0** on the main diagonal.
```
9 9 9 9
9 9 0 0
9 7 9 0
9 0 0 9
```
This one is *not* arrowhead either, because it contains a **7** in place of a **0**.
## More test cases
Truthy:
```
[[1, 1, 1], [1, 1, 0], [1, 0, 1]]
[[1, 2, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]
[[1, 2, 2, 2], [2, 1, 0, 0], [3, 0, 1, 0], [4, 0, 0, 1]]
[[34, 11, 35, 5], [56, 567, 0, 0], [58, 0, 679, 0], [40, 0, 0, 7]]
```
Falsy:
```
[[3, 5, 6], [7, 1, 0], [8, 0, 0]]
[[9, 9, 9, 9], [9, 9, 0, 0], [9, 7, 9, 0], [9, 0, 0, 9]]
[[1, 0, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]
[[1, 6, 3, 4], [13, 2, 0, 6], [29, 0, 1, 0], [2, 0, 0, 4]]
```
  
[Answer]
# Javascript (ES6), ~~48~~ 47 bytes
*Saved 1 byte thanks to edc65*
```
m=>m.some((r,y)=>r.some((c,x)=>(x*y&&x!=y)^!c))
```
Returns `false` for arrowhead matrices and `true` for non-arrowhead matrices (allowed since any two distinct values can be used to represent true and false)
## Test cases:
```
f=m=>m.some((r,y)=>r.some((c,x)=>(x*y&&x!=y)^!c))
console.log(f([[1, 1, 1], [1, 1, 0], [1, 0, 1]]))
console.log(f([[1, 2, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]))
console.log(f([[1, 2, 2, 2], [2, 1, 0, 0], [3, 0, 1, 0], [4, 0, 0, 1]]))
console.log(f([[34, 11, 35, 5], [56, 567, 0, 0], [58, 0, 679, 0], [40, 0, 0, 7]]))
console.log(f([[3, 5, 6], [7, 1, 0], [8, 0, 0]]))
console.log(f([[9, 9, 9, 9], [9, 9, 0, 0], [9, 7, 9, 0], [9, 0, 0, 9]]))
console.log(f([[1, 0, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]))
console.log(f([[1, 6, 3, 4], [13, 2, 0, 6], [29, 0, 1, 0], [2, 0, 0, 4]]))
```
[Answer]
# [J](http://jsoftware.com/), ~~21~~ ~~20~~ ~~19~~ ~~17~~ 15 bytes
### -4 bytes thanks to @GalenIvanov.
```
*-:1,1,.=&/:@}.
```
Takes input as a matrix (rank 2 array).
[Try it online!](https://tio.run/##fZDLCsIwEEX3@YpZiKjUmDaxMUpBXLh05Q/0JUUEwXcEv71OHth0I7c3Jb1nhpke292Gwv5yvzWa5JBR4KgBxD8xZ1KYUKBMmCAkfMw6yN1I2UedXMg9JjxadSjHhjHwOaBSfKRF5gs8UqlMDbNfJDEjb/PTtdbk2Y3MsTAFadubIkZeXXMVyDRRCCr7tjeiw5HZ3@3eIZo6lOOCOCYkyoOJhUV7yOhkuoyjOKLZcLZcf2j4w@uyOcMB6kd90TDKYQUFukRX43DLPvfE/IXW6Pe4/QI "J – Try It Online")
# Explanation
Let the edit history be a lesson to you not to golf and write an explanation at the same time.
```
* -: 1, 1,. = & /: @ }.  Let m be the input matrix.
            = & /: @ }.  Identity matrix 1 smaller than m.
                     }.    Behead (m without its first row).
                   @       Composed with.
                /:         Grade up (get len(m) - 1 unique elements)
              &            Composed with.
            =              Self-classify (compare equality with
                           unique elements)
        1,.              Prepend a column of 1s
     1,                  Prepend a row of 1s
*                        Signum (0 becomes 0, n > 0 becomes 1)
  -:                     Does it match the generated arrowhead matrix?
```
### Visual explanation
Note that this is done on the REPL (inputs are given starting with three spaces and output are given without any leading spaces). Because of that, I sometimes omit composition functions like `@` and `&` since things on the REPL are evaluated right-to-left (functions are more complex).
Suppose you have the following sample matrix:
```
   ] m =. 4 4 $ 1 2 3 4 1 1 0 0 1 0 1 0 1 0 0 1
1 2 3 4
1 1 0 0
1 0 1 0
1 0 0 1
```
First, I'd like to explain (and give a shoutout to) @GalenIvanov's very clever way of generating the identity matrix, which is the following `=&/:@}.`.
First, we behead the input matrix (`}.`).
```
   }. m
1 1 0 0
1 0 1 0
1 0 0 1
```
Then we get the indices each row would be in were the rows sorted using `/:`-grade up.
```
   /: }. m
2 1 0
```
Note that the resulting indices are *unique*: the list has no duplicate elements (and why would it? There's no way to place two elements in the same position in an array).
Finally, we use the niche but helpful `=`-self-classify. This monad compares each unique element to all of the other elements in an array. Remember how I mentioned it was important that the resulting indicies are unique? Since `=`-self-classify does the comparisons in the order that the unique elements appear in the list, the resulting output will be the identity matrix for a unique input (this is why `=@i.` is how you can make an identity matrix of a given length).
```
   = /: }. m
1 0 0
0 1 0
0 0 1
   NB. This is what is happening
   (2 = 2 1 0) , (1 = 2 1 0) ,: (0 = 2 1 0)
1 0 0
0 1 0
0 0 1
```
Once we have the identity matrix, it's a matter of adding a row of ones and a column of ones, which is done very simply (if given an atom - i.e. a single element - the `,` family will repeat it to fill when it's being added):
```
   1,. (=&/:@}. m)
1 1 0 0
1 0 1 0
1 0 0 1
   1, (1,. =&/:@}. m)
1 1 1 1
1 1 0 0
1 0 1 0
1 0 0 1
```
Then we simply compare the generated arrowhead matrix to the signum of the input matrix.
```
   * m
1 1 1 1
1 1 0 0
1 0 1 0
1 0 0 1
   (* m) -: (1, 1,. =&/:@}. m)
1
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 47 bytes
```
Clip@#==Array[If[1<#!=#2>1,0,1]&,{1,1}Tr[1^#]]&
```
[Try it online!](https://tio.run/##LYnBCgIhFAB/5YWwp3fwtatWZBSdunXo9jCQSBLaCPES4rfbsgVzGGZGnx/30ed48y1sbDs@43svrD2k5D98CkxbsbBiuSOUSK7DQkj1kpiuwrmunVN8ZQ5cSj8gECH0CkFVhKL0JNogyIk5rGbXZv0Pg/xNBFOrc@0L "Wolfram Language (Mathematica) – Try It Online")
Explanation: `Clip@#` replaces all the non-zero numbers in the matrix with 1s, then we compare this to an array with dimensions `{1,1}Tr[1^#]` = `{Length@#, Length@#}` with 0 in position `i,j` when `1 < i != j > 1`, and 1 otherwise.
(Roughly based on [Uriel's answer](https://codegolf.stackexchange.com/a/151367/66104).)
Here's another idea that's 16 bytes longer — feel free to steal it if you can golf it down:
```
Union@@Array[{1,#}~Tuples~2&,Length@#]==Most@Keys@ArrayRules@#&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2Zl@z80LzM/z8HBsagosTK62lBHubYupLQgJ7W4zkhNxyc1L70kw0E51tbWN7@4xME7tbIYojSoFKjEQVntf0BRZl5JdFp0dbWxiY6CoaGOgrGpjoJprY5CtakZkGFmrqNgAERgAQsw28zcEipgYgCR1FEwr62Njf0PAA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), ~~19~~ ~~16~~ ~~15~~ 13 bytes
-1 byte thanks to @ErikTheOutgolfer
(`⎕IO←0`)
```
×≡(∧=⌊)/¨∘⍳∘⍴
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v//Ud9UT/9HbRMMuIAsIK1xePqjzoUajzqW2z7q6dLUP7TiUceMR72bweQWTWMFYyBFpGITBRMgZahgBIWGCgZAaAzEIJYJmGf4/z8A)
-2 bytes thanks to @ngn and @H.PWiz
## How?
(2D input matrix **S**)
* `×≡` Check whether **S** is positive only on ...
* `(∧=⌊` ... the diagonals or the top row and left column ...
* `)/¨∘⍳∘⍴` ... of **S**.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~112~~ 108 bytes
```
param($a)$o=+!(0-in$a[0]);1..($x=$a.count-1)|%{$i=$_;0..$x|%{$o*=(!($y=$a[$i][$_]),$y)[!$_-or$_-eq$i]}};!!$o
```
[Try it online!](https://tio.run/##RYrtCoIwGIX/dxUbvMHemmPDr0IG3scQGSEkmDMrUsprX6uI4HA4z8MZ3L0ZL8em67wf7GhPDCyC01vKZNT2YI2ssFBCMJg0WHFwt/4aKXyuH9BqqAspBExvchvNKIM5vAy0lYG6Qg4zGgp15MZQzTn4ZSkoBee9L1nJ4oQTpTiJU05S5CtCSpZmYWc5JzLk53YfzPL93yXye@EkR3wB "PowerShell – Try It Online")
Takes input and manipulates as an array-of-arrays, since PowerShell doesn't support matrices (outside of the .NET Direct3D transform matrices support, which is something entirely different).
The whole algorithm is based on the fact that non-zero numbers are truthy and zero is falsey in PowerShell, and using multiplication to determine those truthy/falsey values.
We first take the first row, `$a[0]`, and check whether `0` is `-in` that array, store that into our `$o`utput variable. If anything in that row is zero, then the `$o` is also zero, otherwise it's one, done by a quick cast-to-int with `+`.
Next we loop from `1` up to `$a.count-1`, setting `$x` along the way -- we're going to be looping through each row one at a time.
Each iteration we set helper variable `$i` to keep track of what row we're on, then loop from `0` to `$x` to iterate each element in this row. Inside the inner loop, we're again multiplying `$o`, this time by selecting from a tuple setup as a pseudo-ternary operator.
The tuple's conditional, `!$_-or$_-eq$i`, says "when we're on the 0th column, or the column matches the row (i.e., the main diagonal)" to select the second half of the tuple when truthy or the first half when falsey. The tuple is composed of `!($y=$a[$i][$_]), $y`. The first half sets `$y` for golfing the second half, but either way we're selecting the current element. The first half does Boolean negation on it, while the second half just takes the element as-is. Thus, if we're not on the 0th column nor the main diagonal, we ensure that the element is zero by taking the Boolean-not of it. Similarly, we ensure the 0th column or main diagonal is non-zero by simply taking it.
So now that we've iterated through every element in the matrix, `$o` is either going to be `0` if some element was incorrect, or some non-zero integer if it is an arrowhead matrix. We double-Boolean-not that to get either `False` or `True` respectively, to make our output consistent, and that's left on the pipeline where printing is implicit.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~14~~ 12 bytes
```
ŒDµḢ;Ḣ€Ȧ>FẸ$
```
-2 bytes from Pietu1998
[Try it online!](https://tio.run/##y0rNyan8///oJJdDWx/uWGQNxI@a1pxYZuf2cNcOlf///0dHW@qY6xjqGMbqRINoAx0DMMsAxIaygOzYWAA "Jelly – Try It Online")
**Explanation**
```
[[9,7,1],
 [7,1,0],
 [7,0,1]]
```
Use the above matrix as an example input.
```
ŒDµḢ;Ḣ€Ȧ>FẸ$
ŒD              Diagonals → [[9, 1, 1], [7, 0], [1], [7], [7, 0]]
  µ             New monadic link
   Ḣ            Head → [9, 1, 1]. Alters diagonals list.
    ;Ḣ€         Append with the head of each of the other diagonals → [9, 1, 1, 7, 1, 7, 7]
       Ȧ        Logical all → 1
         FẸ$    Flatten what's left in diagonals then take logical any → [[0],[],[],[0]] → [0,0] → 0
        >       Matrix is an arrowhead iff result of Ȧ > result of Ẹ
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~21~~ ~~18~~ 17 bytes
```
×≡1⍪1,(=/¨∘⍳1-⍨⍴)
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24TD0x91LjR81LvKUEfDVv/QikcdMx71bjbUfdS74lHvFk2gIgVjIASyFQzh0ACCudIUTIAQImcEhSAZA6AOiBoTMA@kEmaKsYKpgpmCOVjWAiSLZIolEgTpswSqswTTYB4A)
**How?**
This one goes the other way - 
`=/¨∘⍳` - creates the identity matrix
`1-⍨⍴` - for `n - 1`
`1⍪1,` - prepends a column and a row of 1s
`≡` - compares with
`×` - the original matrix, after it has gone an element-wise signum-ing
[Answer]
# [MATL](https://github.com/lmendo/MATL), 15 bytes
```
gtZyXy,!llY(]X=
```
Input is a matrix (using `;` as row separator). Output is `1` for arrowhead, `0` otherwise.
[Try it online!](https://tio.run/##y00syfn/P70kqjKiUkcxJydSIzbC9v//aEMFIxC0BhKGCgYKBtYKxkDKEMQwAfEVDGMB "MATL – Try It Online") Or [verify all test cases](https://tio.run/##lY89DsIwDIV3TmE2hgxufqksNo7AUECRYGIJW5eePnXipgojkpU82@@z7O97TvmVP/NjmRZ1TOl@itMlX2/5OSgoQSACq0DW8VB6WoFRYPd27@j0D1CCyrsDpgNsDxjOBq4bp8AROM@fDw1z56p8GIXEhoaCspV7BKFNFjdyj/1b0CZkIIsgKbUip7I4/nup3wFTb8a6jR47RDfExhU).
### Explanation
```
g        % Implicit input. Convert to logical values (nonzero becomes true and
         % zero becomes false)
t        % Duplicate
Zy       % Size
Xy       % Identity matrix of that size
,        % Do twice
  !      %   Transpose
  ll     %   Push 1 twice
  Y(     %   Write 1 at all entries of row 1
]        % End
X=       % Are the two matrices (input and constructed) equal? Implicit display
```
[Answer]
# [Python 2](https://docs.python.org/2/), 75 bytes
```
lambda m,E=enumerate:all((x[j]>0)-(i>0<j!=i)for i,x in E(m)for j,y in E(m))
```
**[Try it online!](https://tio.run/##nVKxboMwEN35iutmVFdybDAhKpE6pOrQqU2HinogCqhGmESISsnXU9vYTZyx6IZ3d@@98504nsfvQ0@n7dvH9uUTCijLcoHBhMDgIHGQmKrAkaVQDAxDcsUKiUF2qzRhujRQskCZ3CiZLix0k6UYUkNIuQY8u@jTpcU8y70F8R6ZECKKnp9e392Sepb24YaVXWYunZkdqF1cmNYM/SgNs7ngsnlM/rck@fd5@JWS2VMR91CaB1rqtYldrim@pq5Su30FCm@Kuv9R9VCN9arqOoROZSvWJH5Ack0e27tCxs1hAIlPIHvYIGXTFp99Gk@moEzq/o17sOdbRaC/4yD7ETWW@As "Python 2 – Try It Online")**
# [Python 2](https://docs.python.org/2/), 85 bytes
Taking the array as a 1D matrix:
```
def f(m):s=len(m)**.5;print all((v<1)^(0in(p>s,p%s,p//s-p%s))for p,v in enumerate(m))
```
**[Try it online!](https://tio.run/##nVJNa8MwDL3nV@gysDtvdZyvplsHu4wddtq6wwgeBOqwQOKGJC3s12dy4rR1jwsKPOvpPVnCzW//s9di2L5/bl@/YANZlvkMTEgGFnILuclK5o0lgkHAILyocgud07XShGGFowwcZXilDDDhIxlEDCJTEMUI4uSsj1YjjpN0tuCzRyKl9LyX57cPOyT2Qp/YVCXnnitrNjZEFxuGmuDcCmEyJexpapOehuT/Xk98oQzGVXF7UZE6WjFrQzPcsFMFFKSm625TKY1gsbiPHpq21D3kVUXI8dGn34SXmjRPHWtu8F8uuzsElBb7Fhp2hFKD0odatXmv0IIOhqhN2r6QWxiXuPYAv6LK@15ptcOddoea1CyTdGLIiaPDHw "Python 2 – Try It Online")**
[Answer]
# [R](https://www.r-project.org/), ~~78~~ ~~70~~ ~~69~~ ~~68~~ ~~54~~ 53 bytes
```
function(m){d=diag(nrow(m))
d[1,]=d[,1]=1
all(d!=!m)}
```
[Try it online!](https://tio.run/##XY7NTsMwEITvfgrXvexKi5QUaEHCB4TKiRM/p9QHUydVJDeNYgeEqj57sJOUtlg@zKznm3XT@dz5J@1y/nDFi7Za@3JXgcM9c7qu7Q/kX9pCrRuXg5cb136CUIIEChrMapUFa0vnQZDDcKitokV2YEVo7f5at7g30pR6A1Wz@w4WmclSUtJklCqZMm0tmImcbPHQFXD8GYgspHi8ivgok1EmcaoEIp/y99ePJbvkronfEp/H8OLE3fVccuSeH1/e/oMhOice8Jt@URCzHuqrZvfD4rFueEli9ryx@wU "R – Try It Online")
Porting [Luis Mendo's answer](https://codegolf.stackexchange.com/a/151358/67312) is much shorter than my former approach.
Thanks to [rturnbull](https://codegolf.stackexchange.com/users/59052/rturnbull) for pointing out a bug, and golfing down a byte!
### old answer, 68 bytes:
```
function(m,i=which(!m,T))all(i[,1]-i[,2],i!=1,sum(m>0)==3*nrow(m)-2)
```
[Try it online!](https://tio.run/##XY5fS8MwFMXf@ymy@HLvuIW006lgBBF98km3py4P3WhdIO1KkzpE/Ow1aTv/hRDOSc7v3LS9K6y7z23BbmJWdvXO6UMNFj8imzeNeYfiLTfQ5K0twMlX222BK04cOY1ms8m8Ndo64GTRL@rqYDH6jErf2n@3VqTlca93e5hVtELMjQGdUaJif6aK9EwmZLsKqluBUi7mdXs4QoVxin0Jp48Cz7KEWNiK2CTFJEW4VRyRnbHV8/oh@sstiF0QW4bw5Q93NXDixD3ePb38B310Sczj58MgL9IBGqrS63HwVDe@iJD93dh/AQ "R – Try It Online")
[duckmayr's answer](https://codegolf.stackexchange.com/a/151370/67312) tests that all entries on the main diagonal and first row/column (`m[i]`) are nonzero and the rest (`m[-i]`) are zero, using some nice arithmetic to get the diagonal and the first row.
This answer, however, tests to make sure that (1) zero entries are not on the main diagonal or the first row/column, and (2) that there are, given an `n x n` matrix, `3*n-2` nonzero entries.
`which` returns the indices where its input is `TRUE`, and with the optional `arr.ind=T`, returns an array of indices for each array dimension, in this case, two.
Hence when `any(i[,1]==i[,2])`, there exists a zero on the diagonal, and when `any(i==1)`, there exists a zero in the first row or the first column.
Finally, a little arithmetic shows that the number of nonzero entries must be `3*n-2`, `n` from the first column, `n-1` from the diagonal, and `n-1` from the first row.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~80~~ ~~75~~ 69 bytes
```
i;f(A,n)int*A;{for(i=0;i<n*n;)n*=A[i]<1^(i<n|i%n<1|i/n==i++%n);n=!n;}
```
[Try it online!](https://tio.run/##rZHNaoQwEIDvPkW6ICRuShMTjRI9@BzbLZRtLTk0LVtvrs9uY6LB7gYppTL@MHG@b4Y53b@dTuOoZAsbrJHSXdLIvv04Q1UTqSqdaIl0UjcHdazoEzSZi4p1RS/qQde12u9jjaSu77QcRlMN3p@VhijqI2CuKdG9fnXkcAQ16AkGdBXEPwdpf/88m4IW7uKXR73DoIW2FgOGkIx@AKkD0r8AaQiYemBqjjHgKya5gvvklsVg@I2FrS0@PJCt@PxXFhaycGdh0wzTsBkGU@TTLRZsVthXLkqnI8uB2PLxkC@bfVZjLGKZwSnIFjALLSN3QNPZVbgOS6sol@85uWXJQ20LvwzyPysXIUvhLbm3MLt2YlNpuTKki4ffeIwFzJ5i9gzjNw "C (gcc) – Try It Online")
Saved 5 bytes thanks to scottinet! And 6 more thanks to ceilingcat!
Reused the test code from [this answer](https://codegolf.stackexchange.com/a/151376/31625).
Linearly scans the array for any incorrect values, returning 0 for an arrowhead matrix and 1 otherwise. We check by computing the exclusive or of whether the item at a given position is zero and whether that position is on the arrow.
Encoding the information of the 2D array into one dimension leads to a fairly simple set of conditions. If we let `i` be our 0-based index into the `n` dimensional array, then `i<n` describes the first row. Similarly, `i%n==0` describes the first column and `i/n==i%n` describes the diagonal.
The best trick I found for handling the return is to set the dimension to zero when encountering an error. This causes the loop to terminate immediately, then returning the logical negation of the dimension will give us one of two distinct values. scottinet found the way to make GCC return it more nicely.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~92~~ 90 bytes
```
def f(m):l=len(m);return all((m[a%l][a/l]<1)^any([a<l,a%l<1,a/l==a%l])for a in range(l*l))
```
[Try it online!](https://tio.run/##RYzbCsIwDEDf/YqACK0EXHd1un1JqVCw1UHWjbo97OtndxEhDycn4fTT8O5cPM9PY8Gylt@oJuMC3L0ZRu9AEzHWSn0iJfWFVCX4Q7uJSV0RBlsJDLqulwduOw8aGgdeu5dhdCbO5943bmCWSZmkCEIgJBlCphBklgfIC4QozCquK@dFuYs02o4IhVKcw3Hwozn8k6EWGglCunyLAPFWWNa4XFnsrfiXSreU1fQx8xc "Python 2 – Try It Online")
# Credits
* Reduced from 92 bytes to 90 by [Mr. Xcoder](https://codegolf.stackexchange.com/users/59487/mr-xcoder)
[Answer]
# [Haskell](https://www.haskell.org/), 62 bytes
*-3 bytes thanks to Mr. Xcoder. -13 bytes thanks to user28667. -5 bytes thanks to Zgarb.*
```
z=zip[0..]
f m=and[(i==j||i*j<1)==(a>0)|(i,r)<-z m,(j,a)<-z r]
```
[Try it online!](https://tio.run/##pZBBDoMgEEX3PcUssZkaFJWalN6gJyAsSNqm2GqM7cp4dwuKUZLuSmbxGd7/Azz0@3l7vcaxF71pJY1jtbtDLXRzlcQIUQ2D2VenJBKC6DONBmKwi06HHmokFepJdmqstWlAQK3bC5C2M80HYrhHO7BLgpQJgiuF4CX1krqumjicuRSBIWQbNKSD3U@7K4ekgZ0F9uyXndluYgmWI@SOygsrCr6G5MdJF7xccugSxLdB1mYpB/B15tHnrJxN8eXOZ7mMspLPDb@bx5Thc@l/v1Vs7Gz6OervnZZBQLoEZEqBGr8 "Haskell – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
ŒDµḢṠQṭT€E
```
[Try it online!](https://tio.run/##y0rNyan8///oJJdDWx/uWPRw54LAhzvXhjxqWuP6/3A7kAIi9///o4HAUEcBhGJ1FKBMAyjTACQaq8OloABWZKSjYKyjYIKkDlUpCg9TLwiB5I1Q9Bqj6DXB0GsMFDIEShub6iiYgpSYmgEZZuYIE0wtwGwzc0uYIQYwU8xjwcYA/Qi0BmiAGUjaHGGdBdQUqF1AA6AIJAlhwmwBMs0hAlAexAZLJD8aUBA@Zkh6jcFhZQB1rpElim4jmG4ToN9iAQ "Jelly – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~72~~ 71 bytes
```
lambda x,e=enumerate:any(0**n^(0<i!=j>0)for i,r in e(x)for j,n in e(r))
```
*Thanks to @xnor for golfing off 1 byte!*
[Try it online!](https://tio.run/##pVHBboMwDD2Xr/BupPIhJZCUauw7Kq1MYlrQqNa0QkyiX8/sEFSiHoeM9J7t9xwnt/vwfXVqaqGC0/TTXD6/GhjRVtb9XmzfDPbQuHsqt1v3kcrX7qU6v0nRXnvokH4HNh09PaObaS/ExIkj01PyTt8OgaNGCFAGKDlbYwLgmzIEhZCv@uLWiD1rObieRVoVafMnraLUjsqqQCi4pdAEtHk4FHuPtSkXE7m4mNrb0I40hgw0l81j3D64hFlkEIKLM1ymEDRzIrB5QrnaUf7jfvRKq/xdyXDcrIzU2aLOabf6kGz4MUd@zCORza3v3JC29OoiCURMfw "Python 3 – Try It Online")
[Answer]
# Pyth, ~~22~~ 21 bytes
This is definitely not the language for matrix manipulation.
```
.As.e+!MWk.Db,0k,@bkh
```
For each row `b` and its index `k` in the matrix (`.e`), grabs the first and `k`th entries (left side and diagonal) with `,@bkh` and (`+`) all the other entries with `.Db,0k`. If `k` isn't 0 to correspond to the first row (`Wk`), then `!`not `M` all of those entries. Once all of those have been selected, make sure all of them are true. (`.As`) If there's a 0 where there shouldn't be, then the corresponding location will be grabbed as is and mess up the and, and if there's a nonzero where there shouldn't be, it'll be `!` notted to 0, which is also false.
[Test suite.](https://pyth.herokuapp.com/?code=.As.e%2B%21MWk.Db%2C0k%2C%40bkh&input=%5B1%2C2%2C3%2C4%5D&test_suite=1&test_suite_input=%5B%5B1%2C+2%2C+2%2C+2%5D%2C%5B2%2C+1%2C+0%2C+0%5D%2C%5B3%2C+0%2C+1%2C+0%5D%2C%5B4%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+1%2C+1%5D%2C+%5B1%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+2%2C+3%2C+4%5D%2C+%5B1%2C+1%2C+0%2C+0%5D%2C+%5B1%2C+0%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+2%2C+2%2C+2%5D%2C+%5B2%2C+1%2C+0%2C+0%5D%2C+%5B3%2C+0%2C+1%2C+0%5D%2C+%5B4%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B34%2C+11%2C+35%2C+5%5D%2C+%5B56%2C+567%2C+0%2C+0%5D%2C+%5B58%2C+0%2C+679%2C+0%5D%2C+%5B40%2C+0%2C+0%2C+7%5D%5D%0A%5B%5B3%2C+5%2C+6%5D%2C%5B7%2C+1%2C+0%5D%2C%5B8%2C+0%2C+0%5D%5D%0A%5B%5B9%2C+9%2C+9%2C+9%5D%2C%5B9%2C+9%2C+0%2C+0%5D%2C%5B9%2C+7%2C+9%2C+0%5D%2C%5B9%2C+0%2C+0%2C+9%5D%5D%0A%5B%5B3%2C+5%2C+6%5D%2C+%5B7%2C+1%2C+0%5D%2C+%5B8%2C+0%2C+0%5D%5D%0A%5B%5B9%2C+9%2C+9%2C+9%5D%2C+%5B9%2C+9%2C+0%2C+0%5D%2C+%5B9%2C+7%2C+9%2C+0%5D%2C+%5B9%2C+0%2C+0%2C+9%5D%5D%0A%5B%5B1%2C+0%2C+3%2C+4%5D%2C+%5B1%2C+1%2C+0%2C+0%5D%2C+%5B1%2C+0%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+6%2C+3%2C+4%5D%2C+%5B13%2C+2%2C+0%2C+6%5D%2C+%5B29%2C+0%2C+1%2C+0%5D%2C+%5B2%2C+0%2C+0%2C+4%5D%5D&debug=0)
-1 bytes for swapping the orders around.
[Answer]
# [Pip](https://github.com/dloscutoff/pip), ~~31~~ ~~23~~ 22 bytes
```
{0<_!=B>0MC#a==0=_MMa}
```
This is a function that takes a 2D nested list of numbers. [Try it online!](https://tio.run/##K8gs@K/xv9rAJl7R1snOwNdZOdHW1sA23tc3sfa/RphCYZC6jrq1pub/6GhDHQUzHQVjHQWTWB2FaEMgw0hHwQCIQFwjSzDbEMaFyIDUxgIA "Pip – Try It Online")
### Explanation
A whole lot of comparisons going on here. The first thing to know is that comparison operators in Pip can be chained together, like in Python: `5>4>3` is `5>4 and 4>3` (true), not `(5>4)>3` (false). The second is that this doesn't apply to `==`, the "exactly equals" operator. Another difference: regular comparisons have higher precedence than the mapping operators `MC` and `MM` and can be used in lambda expressions, while `==` has lower precedence and can't.
```
{                    }  Define a function with argument a:
 0<_!=B>0MC#a            Generate a matrix (as nested lists) that has 0 on the first row,
                          first column, and main diagonal, and 1 elsewhere (see below for
                          details)
               0=_MMa    Map the function 0=_ to the elements of the elements of a,
                          generating a matrix that is 0 where a is nonzero and vice versa
             ==          Test if the two matrices are equal, returning 0 or 1 accordingly
```
To generate the first matrix, we use `MC`, "map-coords." This operator takes a number, generates a square coordinate grid of that size, and maps a function to each (x,y) coordinate pair, returning a list of lists of the results. For example, `{a+b} MC 3` would give the result `[[0; 1; 2]; [1; 2; 3]; [2; 3; 4]]`.
Here, the size of the grid is `#a`, the size of our original argument. The function is `0<_!=B>0`, which is a shorter way of writing `{0 < a != b > 0}`:
```
{        }  Function; a and b are the arguments (in our case, row and column)
 0<a        Return 1 (truthy) if a is greater than 0
    !=b     and a is not equal to b
       >0   and b is greater than 0
```
This returns 0 for the first row/column and the main diagonal, and 1 elsewhere.
[Answer]
# APL+WIN, ~~36~~ 33 bytes
```
(↑⍴m)=+/(+⌿m)=+/m←×m×n∘.×n←⍳↑⍴m←⎕
```
Prompts for screen input of an APL 2d matrix.
[Answer]
## Clojure, ~~128~~ ~~95~~ ~~92~~ 85 bytes
```
#(every? neg?(for[R[(range(count %))]i R j R]((if((set[i(- i j)j])0)- dec)((% i)j))))
```
It is always exciting to see two consecutive opening brackets.
Original version:
```
#(and(apply =(map assoc(for[i(rest %)](subvec i 1))(range)(repeat 0)))(every? pos?(concat(map nth %(range))(% 0)(map first %))))
```
The first part works by `assoc`ing diagonal elements of the sub-matrix to zero, and checking that all rows are equal :) I used a similar trick at [Jacobian method](https://codegolf.stackexchange.com/a/148324/59617).
Latter part `concat`enates the diagonal + first row and column and checks that they are positive.
[Answer]
# Javascript (ES6), 58 bytes
My solution for Javascript:
```
m=>m.some((r,i)=>m[0][i]*r[0]*r[i]==0|r.filter(c=>i*c)[2])
```
Not as clever as [Herman's](https://codegolf.stackexchange.com/a/151375/77040) answer, but I just felt like I should post it here too.
```
isArrowHead=m=>m.some((r,i)=>m[0][i]*r[0]*r[i]==0|r.filter(c=>i*c)[2])
console.log("-----should be false-----")
console.log(isArrowHead([[1, 1, 1], [1, 1, 0], [1, 0, 1]]))
console.log(isArrowHead([[1, 2, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]))
console.log(isArrowHead([[1, 2, 2, 2], [2, 1, 0, 0], [3, 0, 1, 0], [4, 0, 0, 1]]))
console.log(isArrowHead([[34, 11, 35, 5], [56, 567, 0, 0], [58, 0, 679, 0], [40, 0, 0, 7]]))
console.log("-----should be true-----")
console.log(isArrowHead([[3, 5, 6], [7, 1, 0], [8, 0, 0]]))
console.log(isArrowHead([[9, 9, 9, 9], [9, 9, 0, 0], [9, 7, 9, 0], [9, 0, 0, 9]]))
console.log(isArrowHead([[1, 0, 3, 4], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]))
console.log(isArrowHead([[1, 6, 3, 4], [13, 2, 0, 6], [29, 0, 1, 0], [2, 0, 0, 4]]))
console.log("-----end-----")
```
[Answer]
# Clojure, ~~212~~ ~~206~~ 188 bytes
-6 bytes by removing some missed spaces, and shortcutting `range`. I might have to let this sit so I can think of a better way.
-18 bytes thanks to @NikoNyrh, and creating shortcuts for `map`.
```
(fn[m](let[r range a map z zero?](and(every? #(not(z %))(concat(m 0)(rest(a #(% 0)m))(a get m(r))))(every? z(apply concat(into(a #(take(dec %)%2)(r)(a rest m))(a take-last(r)(reverse(rest m)))))))))
```
Awful, just awful. I don't know why I can't wrap my head around a reasonable solution.
Takes a nested vector as input.
```
(defn arrowhead? [matrix]
  (let [; Get the 0th cell of the 0th row, then the 1st cell of the 1st row...
        main-diagonal (map get matrix (range))
        ; Get the 0th cell of each row
        first-col (rest (map #(% 0) matrix))
        arrowhead (concat (matrix 0) first-col main-diagonal)
        ;
        right-rest (map take-last (range) (reverse (rest matrix)))
        left-rest (map #(take (dec %) %2) (range) (map rest matrix))
        rest-matrix (apply concat (into left-rest right-rest))]
    ; And check them
    (and (every? pos? %) arrowhead
         (every? zero? rest-matrix))))
```
---
I tried rewriting this from scratch using a different method, and it ended up longer. Instead of manually carving out the "rest" sections of the matrix, I instead decided to try generating all the coordinates in the matrix, generating the coordinates of the arrowhead, then use `clojure.set/difference` to get the non-arrowhead cells. Unfortunately, the call to that built-in is costly:
# 223 bytes
```
(fn[m](let[l(range(count m))g #(get-in m(reverse %))e every? a(for[y l x l][x y])k #(map % l)r(concat(k #(do[% %]))(k #(do[0%]))(k #(do[% 0])))](and(e #(zero?(g %))(clojure.set/difference(set a)(set r)))(e #(pos?(g %)))r)))
(defn arrowhead? [matrix]
  (let [length-range (range (count matrix))
        get-cell #(get-in matrix (reverse %))
        all-coords (for [y length-range
                         x length-range]
                     [x y])
        k #(map % length-range)
        diag (k #(do[% %]))
        top-side (k #(do [0 %]))
        left-side (k #(do [% 0]))
        arrowhead (concat diag top-side left-side)
                   ; 22 bytes! Ouch
        rest-cells (clojure.set/difference (set all-coords) (set arrowhead))]
    (and (every? #(zero? (get-cell %)) rest-cells)
         (every? #(pos? (get-cell %)) arrowhead))))
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 11 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)CP437
```
ä¢⌠┐xⁿtH↔BU
```
[Try it online!](https://staxlang.xyz/#c=%C3%A4%C2%A2%E2%8C%A0%E2%94%90x%E2%81%BFtH%E2%86%94BU&i=%5B%5B1%2C+1%2C+1%5D%2C+%5B1%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+2%2C+3%2C+4%5D%2C+%5B1%2C+1%2C+0%2C+0%5D%2C+%5B1%2C+0%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+2%2C+2%2C+2%5D%2C+%5B2%2C+1%2C+0%2C+0%5D%2C+%5B3%2C+0%2C+1%2C+0%5D%2C+%5B4%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B34%2C+11%2C+35%2C+5%5D%2C+%5B56%2C+567%2C+0%2C+0%5D%2C+%5B58%2C+0%2C+679%2C+0%5D%2C+%5B40%2C+0%2C+0%2C+7%5D%5D%0A%5B%5B3%2C+5%2C+6%5D%2C+%5B7%2C+1%2C+0%5D%2C+%5B8%2C+0%2C+0%5D%5D%0A%5B%5B9%2C+9%2C+9%2C+9%5D%2C+%5B9%2C+9%2C+0%2C+0%5D%2C+%5B9%2C+7%2C+9%2C+0%5D%2C+%5B9%2C+0%2C+0%2C+9%5D%5D%0A%5B%5B1%2C+0%2C+3%2C+4%5D%2C+%5B1%2C+1%2C+0%2C+0%5D%2C+%5B1%2C+0%2C+1%2C+0%5D%2C+%5B1%2C+0%2C+0%2C+1%5D%5D%0A%5B%5B1%2C+6%2C+3%2C+4%5D%2C+%5B13%2C+2%2C+0%2C+6%5D%2C+%5B29%2C+0%2C+1%2C+0%5D%2C+%5B2%2C+0%2C+0%2C+4%5D%5D&a=1&m=2)
Unpacked version with 13 bytes:
```
B|AsF:10i^\=*
```
Finally tied Husk and beaten by Jelly by just one byte ...
## Explanation
```
B                Push tail (all except 1st row) of the input array, then push the head (1st row)
 |A              All elements in the head are truthy
                 This will be used as an accumulator
   sF            For each element in the tail, execute the rest of the program
     :1          All truthy indices
       0i^\      Expected truthy indices (0 and the current row number)
           =     The truthy indices are as expected
            *    Perform logical "and" with the accumulator
                 Implicit output of the final accumulator
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~12 11~~ 10 bytes
```
≡¹´Ṫ§^*=ŀL
```
[Try it online!](https://tio.run/##jY87DsIwDIZ3TsEIyEOaZzNwA25QhRkJsVCxAxvH6ITEjJC6RuIg9CLBcdLQEXnw4/9@J96d2n2YHxbtcL0cl/4Vhlvne//89A9/367W7/MmhNA0FWA4oMwoM@zdLCocBMhR@6mlmpIYOOWFFIWUE1JIqCoQChQKSoPSJvOqxkIbmyyMPCZ5QIHGocn7anJExQIFzmJOeywYsLmKO2z@Ifv7Fj2SAo9i9DS3heXESue@ "Husk – Try It Online")
## Explanation
```
≡¹´Ṫ§^*=ŀL  Input is a k×k array A.
         L  The length, k.
        ŀ   The range [0,1..k-1].
  ´Ṫ        Outer product with itself by this function:
             Arguments are two numbers x and y.
       =     Equality of x and y
    §^       to the power of
      *      x times y.
≡¹          Does the result have the same shape and distribution of truthy values as A?
```
The idea is that Husk defines 0 to the power of 0 as 1, so the outer product has 1s on the first row and column.
Also, 1 to the power of any number is 1, so the outer product has 1s on the diagonal.
Other entries are 0 to the power of some positive number, which is 0.
This gives a binary arrowhead matrix, which we compare to the input with `≡`.
[Answer]
# [R](https://www.r-project.org/), ~~81~~ 79 bytes
```
function(x){n=nrow(x);i=c(seq(1,n^2,n+1),1:n,seq(1,n^2,n));all(x[i]>0,x[-i]<1)}
```
-2 bytes thanks to Mr. Xcoder
[Try it online!](https://tio.run/##rZHNCsIwDMfvPkWPLUbo1n04dd58AdHTUNDhoKAVp@JEfPbZdrZUQZwgpG34N/klJGVdpHVxFvmJ7wWuyE2kotxfpDfkaY6PmwP2QCx9EF2PgDcQ4EiEDFfbLa4yvhhTqLIeX4w8cq8LvFudSl7hXEYi16i9CSBVKGWA1lflzKbzCSGd11wfkAwInHT6xrGiAQbfgNZsLnNQwS9ApjqTeSwEpCxSJzaEsK@fKE4aMjUfcRu0JkpgbDpraLTF4GS9N2vqJpqWGP8pthsc/fcmIgtkehtUS37iwHyDDD4g6wc "R – Try It Online")
[Answer]
# C, 117 bytes
```
i,j,r;f(A,n)int*A;{for(i=r=0;i<n;++i)for(j=-1;++j<n;(!i||!j||i==j)&&!A[i*n+j]&&++r)i*j&&i-j&&A[i*n+j]&&++r;return!r;}
```
[Try it online!](https://tio.run/##rZHPboQgEMbvPgVuUgOKCf7XUA8@x3YPjV0bSEobak/qs1tEJe6uMT2UDKjfyPebydT@e12PI8McS9rACgvEROtWtGs@JWSlLAllz4J6HkOTwks/UB9cSdBmfW/zvmdlyZHj2NWZucLjF8fxPImYyx2H@eq40am8tj9S2JIOoyKBj1cmILI6C6g1Ce31uw3OF1CCLsBgG8ScA9W/f0l1oYGnp7cXccKggfouBhFC1LoxDI1hqNIYxBtPcmduxCOKsokfKNGWYsIYRhv/@E@UaI8Sz5Ro6mFqNsFginTa2Wqb5PqRZsWMI2siO@LFe7xk4WmMomRrDzOCHBkme8NIZ0NV2V3MFRYaUazvi3hESffKzswwyP@MPNuj5IaSGkqkx060FBYbQrhy4geOooCFky@cYfwF)
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 186 bytes
```
$a=$($args);if($a[0]-contains0){0;exit};0..($a.Length-1)|%{if($a[$_][0]-eq0-or$a[$_][$_]-eq0){0;exit};$r=$a[$_];$d=$_;if($_-ne0){1..($r.Length-1)|%{if($r[$_]-ne0-and$_-ne$d){0;exit}}}};1
```
[Try it online!](https://tio.run/##ZY1hCoMwDIUvk4EFW9LfpbAD7AZDpMxOBalbKzhwO3sXq@sGSwjkS15ebuNsfejsMMQIRkMBxreBqf5K3RkrfhndZHoXkC2o7KOfXgqFoKU4WddOHZfseVg2OdTVemLvyEe/M9U6@F6D19tKQaOhTp9q7ixJ5Grs/4x9MiEFN65JWmiyH4WSMcZjUcgyJysT4ZaJ8MM77Zwp8Q8RM/YG "PowerShell – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 136 + 2 (`-ap`) = 138 bytes
```
push@a,[@F]}{push@b,"@{$a[0]}"=~/\b0\b/;map{//;map$a[$'][$_]=!$a[$'][$_],0,$';shift@{$a[$']};push@b,@{$a[$']}}1..$#a;say!("@b"=~y/ 0//c)
```
[Try it online!](https://tio.run/##RUzdCoIwGL33KaYNLJjumyUEQ9hVdz2BjtiiUKgczS5E1qO3lkTdnF/OMaf7pfTePGwrFKnFTrppNpokYsKqBumS6kkbDY2m/KrMRGcKFU5ljQ@yiv@aAMEpt213HuZ1iB3//v0Cx/IcLxS3aoyXidDhf6QIKD2uvGeoQFtURAViCBBE64BBRZuPQ@zVm6Hrb9Zn@zIHBj5Tbw "Perl 5 – Try It Online")
[Answer]
# [Clean](https://clean.cs.ru.nl), 79 bytes
```
import StdEnv
?[h:m]=prod h>0&&and[u>0&&n!!x>0&&sum n==n!!x\\[u:n]<-m&x<-[0..]]
```
[Try it online!](https://tio.run/##jZE9b4MwEIZ3foWjSExHZDAfIQrN0g6VumV0PFhAChI2CEyV/PlS2xCaMbrhntO99/ps503J5STaYmxKJHgtp1p0ba/QWRUf8sc50eogWNb1bYGqN@y6XBZ0NCA3m5vJwyiQzDJTXi50PEh29IR7O3oU73aMTWfFe@VsVT@q6p5RSn3QwcBmbDPWtQZNARAIH73/7krPSh0ag1VJVmX4pCQh@D6QCCJdRTFEcbLoo72GOEnnEWxnEsaYs73yZijtrgQiiHU7WZz3dtb4pmBDo8mzYwoJpAsZt3TZFb98q/ihJPp62B4dpKs2sNrQ7Jjpz@rQCc3POv3m14Z/D5P3@TW93yUXdT78AQ "Clean – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 16 bytes
```
Ëe@!X^!(E*Y*nE
e
```
[Test it online!](https://ethproductions.github.io/japt/?v=1.4.5&code=y2VAIVheIShFKlkqbkUKZQ==&input=WwpbMSAyIDIgMl0KWzIgMSAwIDBdClszIDAgMSAwXQpbNCAwIDAgMV0KXQ==)
Man, this takes me back to the good old days when Japt was regularly much longer than other golfing langs...
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~27~~ 30 bytes
**Solution:**
```
x~a*x|a:a|+(a:1,(#1_x)#0)|=#x:
```
[Try it online!](https://tio.run/##y9bNz/7/v6IuUauiJtEqsUZbI9HKUEdD2TC@QlPZQLPGVrnCSsNQwQgErY0UDBUMFAysjYEkkGVtAuIpGGr@/w8A "K (oK) – Try It Online")
**Explanation:**
I must be doing something dumb as the APL solutions are less than half the byte count... 
24 bytes spent creating the arrowhead. `or` together the following three matrices:
```
/ assume 4x4 matrix
=#x
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
+(a:1,(#1_x)#0)
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
a
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0
```
Full breakdown: 
```
x~a*x|a:a|+(a:1,(#1_x)#0)|=#x: / the solution
                            x: / save input as x
                           #   / count length
                          =    / identity matrix
                         |     / or with
           (            )      / do this together
                      #0       / take from 0
                ( 1_x)         / drop first of x
                 #             / count
              1,               / prepend 1
            a:                 / save as a
          +                    / flip rows/cols
         |                     / or with
        a                      / a
      a:                       / save as a
     |                         / or with
    x                          / x
  a*                           / multiply by arrowhead
x~                             / matches input?
```
]