[Question]
  [
A matrix is [antisymmetric](https://en.wikipedia.org/wiki/Skew-symmetric_matrix), or skew-symmetric, if its transpose equals its negative.
The transpose of a matrix can be obtained by reflecting its elements across the main diagonal. Examples of transpositions can be seen here:
\$\begin{pmatrix}11&12&13\\21&22&23\end{pmatrix}\rightarrow\begin{pmatrix}11&21\\12&22\\13&23\end{pmatrix}\$
\$\begin{pmatrix}11&12&13\\21&22&23\\31&32&33\end{pmatrix}\rightarrow\begin{pmatrix}11&21&31\\12&22&32\\13&23&33\end{pmatrix}\$
This matrix is antisymmetric because it equals its transpose when multiplied by -1:
\$\begin{pmatrix}0&2&-1\\-2&0&0\\1&0&0\end{pmatrix}\$
All antisymmetric matrices exhibit certain characteristics:
* Antisymmetry can only be found on square matrices, because otherwise the matrix and its transpose would be of different dimensions.
* Elements which lie on the main diagonal must equal zero because they do not move and consequently must be their own negatives, and zero is the only number which satisfies \$x=-x\$.
* The sum of two antisymmetric matrices is also antisymmetric.
# The Challenge
Given a square, non-empty matrix which contains only integers, check whether it is antisymmetric or not.
# Rules
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest program in bytes wins.
* Input and output can assume whatever forms are most convenient as long as they are self-consistent (including output which is not truthy or falsy, or is truthy for non-antisymmetry and falsy for antisymmetry, etc).
* Assume only valid input will be given.
# Test Cases
```
In:
1 1 1
1 1 1
1 1 1
Out: False
In:
 0 0 1
 0 0 0
-1 0 0
Out: True
In:
0 -2
2  0
Out: True
```
  
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 3 [bytes](https://github.com/abrudz/SBCS)
```
-≡⍉
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///X/dR58JHvZ3/0x61TXjU2/eoq/nQeuNHbRMf9U0NDnIGkiEensH/0xSALKAKYwXjR71bDLlQ@QYKBgqGCgZgeGg9mAVXYaRgBFZxaD2QpWAAAA "APL (Dyalog Unicode) – Try It Online")
This is exactly an [APLcart entry](https://aplcart.info/?q=antisym#) on "antisymmetric". Basically it checks if the input's negative `-` matches `≡` the input's transpose `⍉`.
[Answer]
# [Python 2](https://docs.python.org/2/), 45 bytes
```
lambda A:A==[[-x for x in R]for R in zip(*A)]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUcHRytHWNjpat0IhLb9IoUIhM08hKBbEDAIxqzILNLQcNWP/FxRl5pUouCXmFKfqKKRpREcb6iiAUKwOlwIaIEYqVpOLC2JkSFEp0ESwkQoGOiCEVSNUzgCbnK4hVA5oKrKhIDOB4rpGmJqijYB2gjX8BwA "Python 2 – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 23 bytes
```
function(m)!any(m+t(m))
```
[Try it online!](https://tio.run/##K/qfpmD7P600L7kkMz9PI1dTMTGvUiNXuwTI1PyfppGbWFKUWaFhqKNgDESamlxwoWQNAx0FINI1BFMQZKiJQ6ERUKGRJpg2AhoMAA "R – Try It Online")
Checks whether there are any non-zero elements in \$M+M^T\$.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 5 bytes
5 bytes seems to be the right length for this (unless you're Jelly). Actually, this would be three bytes if Brachylog implicitly vectorized predicates like negation.
```
\ṅᵐ²?
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/P@bhztaHWycc2mT//390tIGOkY5hrE50vJGOgY4BiGEIZsQCAA "Brachylog – Try It Online")
### Explanation
```
\      Transpose
 ṅᵐ²   Map negation at depth 2
    ?  Assert that the result is the same as the input
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~67~~ 64 bytes
-3 thanks to [AZTECCO](https://codegolf.stackexchange.com/questions/208982/antisymmetry-of-a-matrix/209002?noredirect=1#comment493066_209002)
```
i,j;f(m,s)int**m;{for(i=j=0;i=i?:s--;)j|=m[s][--i]+m[i][s];m=j;}
```
[Try it online!](https://tio.run/##bVHRasMgFH2OXyGBgkZlaftWJ/sQ50NIm3FDbUrNIFmWb8@upi0bDMTc6zmec7yp1UddLwvIVjfMy8Dh0heF11PT3RiY1pQaDLwdglKat9/G2@CsUuCEt@Cw0d60el58BRfGJ4LXaX8KfbCOGjqRvaTb@yKU/l8jp0xrPS/vLdZq@6h3cVe7RIg1mTVJEdEPYsjXAF@nrmHJnL/87mzpuOYYJovsiGC0FQEhnF7P8dVVj4CvzueuZpFWPDeUSoPhHNnoS5NxnA5tkzN@hUgeGcrY1plkIAD5GQiTOCSbSXa94dWG5eGwOUrqD@@XXEb0j/KAysMqPAghr599YHnOOX0yRmSMK2NEZ3R5CG/2x1zGEIOzo4uyT@QYzfA/V71Mc4jPmcm8/AA "C (gcc) – Try It Online")
Returns `0` if the matrix is antisymmetric, and a nonzero value otherewise.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 19 bytes
```
@(a)isequal(a',-a);
```
[Try it online!](https://tio.run/##y08uSSxL/Z9mG/PfQSNRM7M4tbA0MUcjUV1HN1HT@n9KZnGBRppGtKEOEFojkbGamlwwSQMdA6AwiDSw1jUEUaiyukbWRmCx/wA "Octave – Try It Online")
The semicolon doesn't *need* to be there, but it outputs the function otherwise, so I'll take the one-byte hit to my score for now.
# Explanation
It's pretty straightforward - it checks to see if the matrix of the transpose is equal to the negative matrix
[Answer]
# JavaScript (ES6), 42 bytes
Returns *false* for antisymmetric or *true* for non-antisymmetric.
```
m=>m.some((r,y)=>r.some((v,x)=>m[x][y]+v))
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/X1i5Xrzg/N1VDo0inUtPWrgjKK9OpAPJyoytioytjtcs0Nf8n5@cV5@ek6uXkp2ukaURzKShEKxjqgJFCrA5eLlespiYXNv0KBjogBNcB5RvA@LqGMD5OI4DSukYw9UY6CjDF/wE "JavaScript (Node.js) – Try It Online")
[Answer]
# [Io](http://iolanguage.org/), 67 bytes
```
method(~,~map(i,\,\map(I,V,V+x at(I)at(i)))flatten unique==list(0))
```
[Try it online!](https://tio.run/##fY8/C8IwEMX3forbzOEVU62LUHDtIDpIpy5BUwy2aTUJOPWrx1gQ/xRK4HI/uPfunmp9BZsMSt9Ie2nPrKe@ER1TVFL5anIqqJg/QFiWYygKEataWCs1OK1uTmZZrYxlHNEvFnCUxsJJGGmgurcN7A9RVLFhIgIY/oTCQ5rEQIjQ3ZW2tR45ACf@rRmYfzhOBp424RQvP5IlwUgQ4mx37ur0WehVks4M2He6kVuc/p7Aaf2LYd1fLP8E "Io – Try It Online")
## Explanation
For all `a[x][y]`, it checks whether all `a[x][y]+a[y][x]==0`.
```
method(~,                                 // Input x.
    ~ map(i,\,                            // Map all x's rows (index i):
        \ map(I,V,                        //     Foreach the rows (index I):
            V+x at(I)at(i)                //         x[i][I] + x[I][i]
        )
    ) flatten                             // Flatten the resulting list
    unique                                // Uniquify the list
    ==list(0)                             // Does this resulting list *only* contain the item 0?
)
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 5 bytes
```
qC_MM
```
[Try it online!](https://tio.run/##K6gsyfj/v9A53tf3///oaAMdBaNYHYVoXSMdBYPY2H/5BSWZ@XnF/3VTAA "Pyth – Try It Online")
## Explanation
```
qC_MM
q      : Check if input equals
 C     : Transpose of
  _MM  : Negated input
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 5 bytes
```
!_GX=
```
[Try it online!](https://tio.run/##y00syfn/XzHePcL2//9oQwUgtFZApmIB "MATL – Try It Online")
## Explanation
```
!_GX=
        // Implicit input on top of stack
!       // Replace top stack element with its transpose
 _      // Replace top stack element with its negative
  G     // Push input onto stack
   X=   // Check for equality
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 5 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
eUy®n
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=ZVV5rm4&input=W1sxLDAsMV0sClswLDAsMF0sClstMSwwLDFdXQ)
```
e       compare input with :
 Uy       columns of input
   ®n     with each element negated
```
Previous version `ÕeËËn` didn't work, corrected using the ® symbol
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 10 bytes
```
⁼θＥθＥθ±§λκ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMO1sDQxp1ijUEfBN7EAifJLTU8sSdVwLPHMS0mt0MjRUcjWBAPr//@jo6MNdBR0jWJ1uBQUoo10FAxiY2P/65blAAA "Charcoal – Try It Online") Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` if the matrix is antisymmetric, nothing if not. Explanation:
```
  Ｅθ        Map over input matrix rows (should be columns, but it's square)
    Ｅθ      Map over input matrix rows
       §λκ  Cell of transpose
      ±     Negated
⁼θ          Does matrix equal its negated transpose?
```
[Answer]
# [Wolfram Mathematica](https://www.wolfram.com/mathematica), ~~20~~, 7 bytes
There is a [built-in function](https://reference.wolfram.com/language/ref/AntisymmetricMatrixQ.html) for this task:
`AntisymmetricMatrixQ`
But one can simply write a script with less byte counts:
`#==-#ᵀ&`
The `ᵀ` character, as it is displayed in notebooks, stands for transpose. But if you copy this into [tio](https://tio.run/), it won't be recognized because these characters are only supported by Mathematica notebooks.
[Answer]
# [Julia 1.0](http://julialang.org/), 9 bytes
```
A->A==-A'
```
A straightforward anonymous function checking the equality.
[Try it online!](https://tio.run/##yyrNyUw0rPifWZyYV5JZXJmbm1pSlJls@99R187R1lbXUf2/Q3FGfrkCmgKNaEMFILRWQKZiNblwKDZQMACpAlEG1gq6hiAan2pdI2sFI5CS/wA "Julia 1.0 – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 5 bytes
```
§=T†_
```
[Try it online!](https://tio.run/##yygtzv7//9By25BHDQvi////Hx1toGOgYxirA6YNgLSuIZgRCwA "Husk – Try It Online")
[Answer]
# Google Sheets, ~~90~~ ~~88~~ 41
(Now with lambdas)
Closing parens discounted.
## Named Functions (name, args, and formula text all count):
| Name | args | Formula |
| --- | --- | --- |
| `P` | `a`, `b` | `a+b` |
| `Q` | `a` | `MAP(a,TRANSPOSE(a),P)` |
## Formula:
```
=SUM(Q(A1:C3))
```
No, I cannot currently use `ADD` instead of `P` as it is not a lambda.
## How it Works:
Add the matrix to its transpose. If the resulting matrix is all 0's, then the sum of all elements is 0, which means we the two are equal.
Return 0 if equal, some positive number otherwise.
[Answer]
# [Haskell](https://www.haskell.org/), 40 bytes
```
(==)<*>foldr(zipWith(:).map(0-))z
z=[]:z
```
[Try it online!](https://tio.run/##XY2xDsIgEIZ3nuIGBzBggG6N@AbODshAVCyRq6TtxMOLtHEyl8v333eX3ODn1yOlGsy1UmPYcX8K73SfaIn5EpeB9uyAPlMpGCukGOv6UlGBAWsVb@X4Hx1Bva0ll5teKRuF2oIDgt3vQOjm9SoJ@jg2236dIU9xXGC3DhDAouKAunXn6ucWkn/OVdxy/gI "Haskell – Try It Online")
Uses [this tip for shorter transpose](https://codegolf.stackexchange.com/a/111362/20260) and the idiom of `(==)<*>` to check invariance under an operation.
[Answer]
# [Haskell](https://www.haskell.org/), ~~49~~ 47 bytes
```
import Data.List 
f x=x==transpose(map(0-)<$>x)
```
[Try it online!](https://tio.run/##HcYxDoAgDADA3Vd0cNAEDO7i5OgPCEMHjY2CBDrw@2qY7i4s9/E8IhTSmxk2ZJx2KgzdCdVWazljLOktxxAwDUaPS7/WUQJSBAspU2To4XTOKKNmr5rmV88tHuQD "Haskell – Try It Online")
* saved 2 thanks to @Unrelated String
My first Haskell.  
Function tacking a matrix and checking if input is equal to input mapped to (0-value) and transposed
[Answer]
# Scala, 32 bytes
```
l=>l.transpose==l.map(_.map(-_))
```
Finally, something that Scala has a builtin for!
The function's pretty straightforward - it compares the transpose of a `List[List[Int]]`(doesn't have to be a `List`, could be any Iterable) to the negative, found by mapping each list inside `l` and using `-` to make it negative.
[Try it in Scastie](https://scastie.scala-lang.org/oIWhqnLcRhaTGOgoR4HV2Q)
[Answer]
# [Ruby 2.7](https://www.ruby-lang.org/en/), 40 bytes
```
->a{a==a.transpose.map{|r|r.map{|c|-c}}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6xOtHWNlGvpCgxr7ggvzhVLzexoLqmqKYIwkiu0U2ura39X6CQFh0dbagDhLE6aHRsLBdE2kDHACwMog2AtK4hmIEkr2sEFDYCi/0HAA)
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 5 bytes
```
Z_=-_
```
A function submission; pass a nested list as its argument. [Try it online!](https://tio.run/##K8gs@K/xPyreVjf@f3S0gbWCkbVhLJdCtK6RtYG1AZhlCGbFcmn@BwA "Pip – Try It Online")
### Explanation
```
Z_     The argument, zipped together
  =    Equals
   -_  The argument, negated
```
[Answer]
# [gorbitsa](https://esolangs.org/wiki/GORBITSA)-ROM, 8 bytes
```
r1 R A1 B0 T
```
This is an awful abuse of rule
> 
> Input and output can assume whatever forms are most convenient.
> 
> 
> 
If input takes form of "arr[i][j] arr[j][i]", the problem becomes "is sum = 0?".  
This code takes pairs of values and outputs their sum if it's not 0
Thus if you provide matrix as previously mentioned pairs, code will return some value for not-anti-symmetric ones and will not return anything for anti-symmetric ones.
```
r1 R A1 B0 T
r1           #store first number
   R         #read second number
     A1      #add first number
        B0   #if sum==0, jump to the beginning
           T #else output the sum
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
N⁼Z
```
[Try it online!](https://tio.run/##y0rNyan8/9/vUeOeqP///0dHG@gY6BjG6oBpAyCtawhmxAIA "Jelly – Try It Online")
Posting before caird coinheringaahing finds this question.
[Answer]
# [Java (JDK)](http://jdk.java.net/), ~~89~~ ~~87~~ 86 bytes
* -2 bytes thanks to Calculuswhiz!
```
m->{int i=0,j,r=1;for(;++i<m.length;)for(j=0;++j<i;)r=m[i][j]!=-m[j][i]?0:r;return r;}
```
[Try it online!](https://tio.run/##jZJBb4JAEIXv/oqpJ0hhgx5dsWnaNOmhJ4@Ew4qLXQoL2R1MreG301G2YhPTlJDM8ob35c1AIfYiLLYffVYKa@FNKA3HCYBFgSqDgtqsRVWyvNUZqlqzF3dYKo1JmqQBvGqUO2lWkEPcV@HqSB1QcRQUgYlnPK@Nx@/v1bJipdQ7fOf@SSriiNRiqbhv4ipRaVKkd3FYUaGHh2hhuJHYGg2Gdz2fUKim3ZQUymXb12oLFQX21miU3iUpZGqvSvUlt89yI1Ba/zwLgIsKJOGTsNLSOXY9uFQ4zgI43V3wD8UJl85IiQKIfnsGJbpSwpmT/sTMrx3za8Lg6/i50DrB@5mxErSNT1iMw/oX6PpgUVasbpE1tDIstTcNb1xTnzvHiAZhDFEHvH8LNf4sj8aIg2VYD1/GI6t/Qd5w5kw0TXnwHNy9epqxm3T9Nw "Java (JDK) – Try It Online")
Returns 0 for `false` and 1 for `true`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 3 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ø(Q
```
[Try it online](https://tio.run/##yy9OTMpM/f//8A6NwP//o6MNdIx0dA1jdaJ1jXQMdAyADEMwHQsA) or [verify all test cases](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaCkU3loudG5LVmHdutwKfmXlkBE7Std/h/eoRH4X@fQNvv/0dHRBjpGOrqGsTrRukY6BjoGQIYhmAYygCwgBIsg0yAZoAqwiAFUjy5Ck4GOrhGQNgJxYwE).
**Explanation:**
```
ø    # Zip/transpose the (implicit) input-matrix; swapping rows/columns
 (   # Negate each value in this transposed matrix
  Q  # And check if it's equal to the (implicit) input-matrix
     # (after which the result is output implicitly)
```
[Answer]
# [Factor](https://factorcode.org/) + `math.matrices`, 19 bytes
```
[ dup flip mneg = ]
```
[Try it online!](https://tio.run/##bY6xCsIwFEX3fMX9gZa0oyK4iYuLOIlDia8aTGP6kg5S/PYYY7rJhcs7nDu8vlPhyfF03B92KzyILRl4GieyijyGLtzrVKy/5JhCeDnWNmAtxIwZTc5b4P@dKM8gUxaXQRaomh8sS4mqLapFEfGM6@TQG@0wWLphg0tMP21ReyhDHccP "Factor – Try It Online")
* `dup` make a copy of the input
* `flip` transpose it
* `mneg` negate it
* `=` are they equal?
[Answer]
# [Raku](https://raku.org/), 26 bytes
```
{none flat $_ »+«[Z] $_}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/Oi8/L1UhLSexREElXuHQbu1Dq6OjYoHs2v/FiZUKSirxeumZxSUamgq2dgrV9mkgGSWFtPwiBQ0NQx0g1NRBo4EMDQMdA7AIiDYA0rqGYAZEStcISBuBuP8B "Perl 6 – Try It Online")
* `$_` is the input matrix, in the form of a list of lists of integers.
* `[Z] $_` is the transpose of the input matrix.
* `»+«` adds the input matrix to its transpose.
* `flat` flattens the matrix into a single list of numbers.
* `none` converts that list of numbers into a junction which is true if and only if none of the numbers is truthy, that is, nonzero.
The none-junction is returned. It is truthy only if adding the matrix to its transpose results in a matrix containing all zeroes.
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 28 bytes
Port of [Razetime's Ruby answer](https://codegolf.stackexchange.com/a/208998/11261).
```
:=~&(:transpose|:*&(:*&:-@))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWe6xs69Q0rEqKEvOKC_KLU2ustIBcLTUrXQdNTYiSm0EFCm7R0dGGOkAYq4NGx8ZyQaQNdAzAwiDaAEjrGoIZSPK6RkBhI7AYxOQFCyA0AA)
## Explanation
```
:=~ & (:transpose | :* & (:* & :-@))
       :transpose |                   # Transpose input, then
                    :* & (        )   # Map with
                          :* & :-@    #   Map with negate
:=~ & (                            )  # Equal to input
```
[Answer]
# k, 7 bytes
Similar to the APL solution. Compare (x~) original matrix against negated transpose (-+x}
```
{x~-+x}
```
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata) + `-e`, 3 bytes
```
Ť_=
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHFNtJJurpKOgpJuqlLsgqWlJWm6FkuOLom3XVKclFwMFVhw0zk62lAHCGN10OhYruhoAx0DsAiINgDSuoZgBkRK1wgoYgTiQswCAA)
```
Ť     Transpose
 _    Negate
  =   Check equality
```
]