[Question]
  [
Input a non-empty array with \$n\$ positive integers. Test if the input array contains every integer in \$1\cdots n\$.
In case you prefer 0-indexed numbers, you may choose to input an array of non-negative integers, and test if the input array contains every integer in \$0\cdots (n-1)\$ instead. All testcases and formula listed below use 1-index. You may need to adjust them if you choose this option.
## Input / Output
Input is an array \$A\$ with \$n\$ positive integers:
$$ A = \left[A\_1,\dots,A\_n\right] $$
$$ \forall i \in \left[1,\dots,n\right]: A\_i>0 $$
Output if input \$A\$ satisfies:
$$ \forall i \in \left[1,\dots,n\right]: i \in A $$
Output would be two distinct values, or truthy vs falsy values (swap meaning of truthy / falsy is allowed).
## Rules
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest code wins. And since this is code-golf, don't worry about time / memory complexity of your code. You may even timeout on TIO as long as your program works when giving it more time to run.
## Testcases
### Truthy
```
1
1,2
2,1
1,3,2
3,1,2
1,2,3,4,5,6,7,8,9,10,11,12
12,11,10,9,8,7,6,5,4,3,2,1
6,3,8,12,1,10,4,2,7,9,5,11
16,37,14,15,23,8,29,35,21,6,5,34,38,9,36,26,24,32,28,7,20,33,39,12,30,27,40,22,11,41,42,1,10,19,2,25,17,13,3,18,31,4
```
### Falsy
```
2
12
1,1
1,3
2,3
3,3
2,1,3,2
1,4,3,1
4,1,2,4
1,2,2,5,5
1,3,3,3,5
8,7,5,3,4,1,6
5,7,1,4,6,1,8,3
6,3,5,4,7,1,8,1,2
6,5,3,8,2,7,9,4
1,1,1,1,1,1,1,1
1,5,9,13,11,7,3
14,6,12,4,10,8,16,2
34,33,38,17,35,11,36,31,28,14,6,15,18,2,19,40,29,41,9,1,27,23,20,32,26,25,37,8,13,30,39,7,5,3,21,4,11,16,10,22,12,24
38,27,20,23,31,6,2,24,21,31,33,7,26,12,14,17,3,2,28,31,5,23,28,27,37,32,7,39,22,6,35,42,19,3,35,17,35,40,22,13,27,7
```
  
[Answer]
# [Risky](https://github.com/Radvylf/risky), ~~7 bytes~~ 7 bytes and a palindrome
```
1_??!0:0!??_1
```
[Try it online!](https://radvylf.github.io/risky?p=WyIxXz8_ITA6MCE_P18xIiwiW1s2LDMsOCwwLDEsMTAsNCwyLDcsOSw1LDExXV0iLDBd)
## Explanation
```
1   sort
_
?         input
?     filter by
!       factorial
0         0
: =
0   range
!       length
?         input
?     find first number such that
_
1         1
```
[Answer]
# [J](http://jsoftware.com/), 7 bytes
```
-:/:@/:
```
[Try it online!](https://tio.run/##VVHLasNADLznK0wvoSAnXmkf9tJCoNBTT/2IBPr/d2dm1jmUOItWK81oRn/722U636fPPp1tWqaO/3yZvn5/vve5X/vt2vf304Pv91v/6PtjsoR7MsfpRxy6hY0sTmSyFavWbLXN0mIpWdKjK1yQXfFaUZXZL6SKaDWWsCIj21BX0MFOvDZL2VIxZ51vFgiTQAIopIpqjg83NyeDLxZhsRE2FvNmGaemyPgOrrSBzMEEBlRbWi3weprnGdSSdcz/kiz5IdkjftmQJIhVmYYAZFjimLIg5lBFBmFy3Avu7Kk4V2HRBtrSlBmmSiNFy5KB@e@nTKHZQW1NSEmwTq6FUHUsKsuSlWqD7tI1yIVfo6FQv9MUerXRqI1zNBpPQ10mFy5klWELHR66nGK440pSOo1qDgxC1z4AEtwa8yzHBfM0YnL3WXOZ9hfURFL1gi5oALiAWzl81pghHVJzbDdY354 "J – Try It Online")
Ninja'd by hyper-neutrino :(
Takes zero-based input. Applying Grade Up twice to a vector gives a "ranking" of each element, so that 0 is the smallest, 1 is the next smallest, ... up to n-1, breaking ties by giving a smaller number to the one appearing first. A vector is a permutation if and only if the ranking is identical to itself.
# [J](http://jsoftware.com/), 7 bytes
```
2|C.!.2
```
[Try it online!](https://tio.run/##VVHLasRADLv3K9JeloITMva8ElooLPTUUz9iF/oN/fdU0mQPZbODx2NLlvxzvCzT5Ta979PFpnXa8Z@X6fr99Xn473V5Xvx4fbrz/faxv@3HfbKEezLH6WccuoWNLE5kshWr1qzbZmm1lCzp0RWuyHa8VlRl9gupIurGElZkZBvqCjrYiddmKVsq5qzzzQJhEkgAhVRRzfHh5uZk8NUiLDbCxmreLOPUFBnfyZU2kDmYwIBqS90Cr0/zPINass75H5IlPyR7xA8bkgSxKtMQgAxLHFMWxByqyCBMjnvBnT0VZxcWbaAtTZlhqjRStCwZmP9@yhSaHdTWhJQE6@RaCVXHorIs6VQbdJeuQS78Gg2F@p2m0KuNRm2co9F4GuoyuXAhXYatdHjocorhjitJ6TSqOTAIXfsASHBrzLMcF8zTiMndZ81l2l9QE0nVC7qgAeACbuXwWWOGdEjNud1gffsD "J – Try It Online")
Takes zero-based input. `C.!.2` is a built-in for "cycle parity". It gives 1 if a permutation has even number of swaps, -1 if odd, and 0 if not a valid permutation. I take it modulo 2 to convert all nonzero results to 1 (the only truthy value in J).
~~Even if [error/non-error output](https://codegolf.meta.stackexchange.com/a/11908/78410) were allowed, it is too bad that permutation-related built-ins `A.` and `C.` don't error on all possible non-permutations.~~
# [J](http://jsoftware.com/), 7 bytes
```
#\-:/:~
```
[Try it online!](https://tio.run/##VVG7bgMxDNvzFUY7BAV0qS35cXdApwKdOnXunAD9iP76laSTocjFkGWJFKmf4@mSztf0tqezpZx2/JdLev/6/Diev5f9df89Xk43vl@PW7KCuJjj9HscuoXNLE5kqjXrNmy1zUq2Uqzo0RVmZFe8dlRV9gupI1qNJayoyA7UNXSwE6/DSrXSzFnnmwXCIpAACqmim@PDzc3J4NkiLDbCRjYfVnFqiorvzlU2kDmYwIBqK6sFXk/LsoBasu7zPyRLfkj2jB82FAliVaUhAJmWOKZsiDlUk0GYHPeGO3s6zlVYtIG2DGWmqdJI0bJkYv77KdNodlDbEFIRrJMrE6rPRVVZslJt0F26BrnwazY06neaQq82GrVxjkHjaajL5MaFrDIs0@GpyymGO@4kpdOo5sAgdO0DIMGtMc9yXDDPICZ3XzWXaX9BTSRVL@iCBoALuJ3DV40Z0iE19@0G68cf "J – Try It Online")
Takes one-based input. `#\` is a golfing trick for getting 1..n, which is compared to the sorted array `/:~` of the original.
---
If output by erroring/non-erroring is allowed:
# [J](http://jsoftware.com/), 3 bytes
```
C.~
```
[Try it online!](https://tio.run/##VVHLasNADLznK0wvoSAbr7QvmxYKgZ566kck0I/or7szs86hxFm0WmlGM/o5Xpbpep/e9@lq0zrt@M/LdPv@@jxuy@/xennw7f6xv@3HY7KEezLH6WccuoWNLE5kshWr1qzbZmm1lCzp0RWuyHa8VlRl9gupIurGElZkZBvqCjrYiddmKVsq5qzzzQJhEkgAhVRRzfHh5uZk8NUiLDbCxmreLOPUFBnfyZU2kDmYwIBqS90Cr5d5nkEtWef8T8mSH5I94qcNSYJYlWkIQIYljikLYg5VZBAmx73gzp6KswuLNtCWpswwVRopWpYMzH8/ZQrNDmprQkqCdXKthKpjUVmWdKoNukvXIBd@jYZC/U5T6NVGozbO0Wg8DXWZXLiQLsNWOjx0OcVwx5WkdBrVHBiErn0AJLg15lmOC@ZpxOTus@Yy7S@oiaTqBV3QAHABt3L4rDFDOqTm3G6wvv0B "J – Try It Online")
Takes zero-based input. Abuses dyadic form of `C.`, whose left argument must strictly be a permutation. It throws an `index error` otherwise.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 5 bytes
```
⊢≡⍋∘⍋
```
[Try it online!](https://tio.run/##VZJNSgNBEIX3OUVdQJiu6r9Zu9Gt8QIBiZuAbl0LQRMSdCG41Qu48QQepS8yvlc9ESRDU11df@@rrO43ZzcPq83d7TS13Wd7/miHfXt6xzmt2/alHY5t9/jzZW372o5vy6tznNcXl8tpLUHa4VvCgpbi1Nk2v9nsxQk7SpIsRaqMEgYJQYI/qpsDvBWvGVGR@V4pw6oewogIb0FcQgYz8VokRAlJlHE6isEMXsRQha0si@LDTUXZQQcxExtZ1gbRIhGnTxHxzb3CiGaKTuhgVFLF8Lo4adY/q6s4CXcI5uK7fYIRXBajogOJMxjFrAk2R0uOCfPjnnBnTsZZvRZhEE5xT0frSindwfSa/37uSURuVFi8UvCyyl4DS@W@ruhgKjUbGZMdRINaT0ikoERDYiNxjZyjED@xqqNOXEt1bAM5d11KMdx0ZlPyRjQHRkP1raCIcXf0MxwXzFNYk/@A6HOJb9GoiU09F@2MANALdTOHjz6muQ5XM@/YGF9@AQ "APL (Dyalog Unicode) – Try It Online")
-4 bytes thanks to Bubbler by turning this into a train and via using `⍵≡` to match the whole array instead of `∧/⍵=` to match element-wise and then reduce by AND.
```
⊢≡⍋∘⍋    Train
 ≡         Check equality between
⊢         (Right argument ⍵) and
  ⍋∘⍋    Composed function {⍋⍋⍵}; grade up twice
```
Grading up twice gives the minimum permutation of length X that has the same (non-strict) ordering as the original - so, if the permutation of the right order is the same as the original, then the original was that permutation and thus a permutation.
[Answer]
# [Haskell](https://www.haskell.org/) (1 indexed), 29 bytes
*Courtesy of AZTECCO*
```
g l=all(`elem`l)[1..length l]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P10hxzYxJ0cjITUnNTchRzPaUE8vJzUvvSRDISf2fxpQNl0lN7FAI6ZC165C21Azhys3MTPPNiWfS0GhoCgzr0QlLdowFpmjY4DMNdAx0jHWMdExRBU0BEKgBLpKDHUm2ASNsQlDrDGN/Q8A "Haskell – Try It Online")
# Haskell (0 indexed), ~~42~~ ~~32~~ 31 bytes
*Lynn saved one byte with the pointfree solution.*
```
all.(.fst).flip elem<*>zip[0..]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P802MSdHT0MvrbhEUy8tJ7NAITUnNddGy64qsyDaQE8v9n9uYmaebUo@l4JCQVFmXolKWrRBLBLHUAeFa6BjpGOsY6JjiCpoCIRACXSVGOpMsAkaYxOGWGMa@x8A "Haskell – Try It Online")
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Both of these check that every integer in the available range is in the list. The first is `1` to the length of the list, the second is `0` to 1 less than the length of the list.
[Answer]
# [Python 3](https://docs.python.org/3/), 31 bytes
Input is \$ 0 \$-indexed.
```
lambda a:{*a}=={*range(len(a))}
```
[Try it online!](https://tio.run/##VVFBbtswELzzFbxFCraFlkuKUgC/JO1BRe1GgKIIjoomCPJ2d2adHALLJJcczuwMt9f94Wm1y@nw47JMj79@T3G6e7ud3g@Ht9vztP45Nstxbaa2fb/8e5iXY9S7EOd1i4e4zM978zhtzbzuwr2/e9N@f96WeW9u5KZt20/k/Uv8FjWens7xBVvc/RnidsbF5oTrW9teNKikkISzYWXCGn9UWYr0UmWQUbQTVVEcJV902Btw1gOTeRMMPeZBCOB5xl4FqgAfFGdVNIsWSUSlUQxLdQIDA0Wsl4QPVZJE9tSJmdhIUuskVckYvYOM70NJR0gl6EABaNFBDKeBzcKKW4NFgznOV6PqbWvINAwwx4ReSqBwcfvoLhRUxPYYwesmabl6zbDcAS25XTJ9@aEuDNDYdQWDOlkif0eKnrFnNzrQgzExZgETSOEKL3SVaJUJjLQ/Ur0yTsaUPLrCmAePoWNuVyeJBvhqPSWZH9A5QC55xqAwvgR3CUaBbioZ@ZrZuxJ/E6MbSvpdiBltQwmsPVvP3qS5C/fy8WJGfP0P "Python 3 – Try It Online")
This is the most obvious implementation I could think of. It compares the set of \$ a \$ to the set of numbers from `0` to `len(a)-1`.
# [Python 3](https://docs.python.org/3/), 30 bytes
As [@ovs](https://codegolf.stackexchange.com/users/64121/ovs) suggested, we can save a byte by switching the definition of truthy and falsey. A valid permutation returns a falsey value, and truthy otherwise.
```
lambda a:{*a}^{*range(len(a))}
```
[Try it online!](https://tio.run/##VVHRTtwwEHz3V/iNBC0o67XjBIkvaamUqnclUgjREVQqxLcfM3v0obqc7bXHMzvj7e/@@Lza@Xj//bxMTz9/TXG6e7@ePn68X5@m9fehWQ5rM7Xtx/nP47wcot6FOK9bvI/L/LI3T9PWzOsu3Hvdm/b2ZVvmvbmSq7Zt/yG/vcWbqPH4fIpv2OLuQ4jbCRebI65vbXvWoJJCEs6GlQlr/FFlKdJLlUFG0U5URXGUfNFhb8BZD0zmTTD0mAchgOcZexWoAnxQnFXRLFokEZVGMSzVCQwMFLFeEj5USRLZUydmYiNJrZNUJWP0DjK@LyUdIZWgAwWgRQcxnAY2CytuDRYN5jhfjKq3rSHTMMAcE3opgcLF7aO7UFAR22MEr5uk5eo1w3IHtOR2yfTfD3VhgMauKxjUyRL5O1L0jD270YEejIkxC5hAChd4oatEq0xgpP2R6pVxMqbk0RXGPHgMHXO7OEk0wFfrKcn8gM4BcskzBoXxJbhLMAp0U8nI18zelfibGN1Q0u9CzGgbSmDt2Xr2Js1duJevFzPi6yc "Python 3 – Try It Online")
[Answer]
# JavaScript (ES6), 30 bytes
Expects 0-indexed values. Returns a Boolean value.
```
a=>a.every(x=>(a[~x]^=1)/a[x])
```
[Try it online!](https://tio.run/##VVHLbtswELzzK4RcJAIbVXzp0cLuqf2BHNMUEBw5VeFKruQGDor2192ZtS@FJFJLDmd2ht/7137dLePxdD/Nz8Nlv7n0m21fDq/D8lacN9uif/x7fvq6cfZd/3h@spdl@PlrXIYi36@5LZehf/48HoaHt2lXVLY8zQ@nZZxeCluux8N4Ku6@THe23M/Lp373rVizzTb7bbJsN0/rfBjKw/yCxY/ZvlhvB3IB7Y/@WEzETtl95qzN3md5bj@YP/bijBNvvHAO@AvCGh@qKElqaaSVTlwlzonDltefCmst9mpgIk@CocbcCgHcj1hrgErAG4e9RlwUl8QT5TsJ@HVKEMBAkVCLx4vKiye7ryQECR1JQyW@kYhRO4h4b0qug5SHDhSAFtdKwK4x7BZe1Bs8BrjjfHXqtG9nIh0DzdGjmaRJ8EmGPSRNAo2ahIqnaoyQUL9032jN3NQM3alzcv73oE7MMtBAAwanZJ78FSlq3kBUzy3tBIbHWOAHgVzhiQY9XTOMjkl0VG@YLBPzmmJi4q0mUjHCqxNPA7zAmpKMEuhoIOc1blAEXgpXCUaBbhoy8mKjdiV6PYFuKKlnIRZoG0pgrdl61CaDulAvt8sLxDf/AA "JavaScript (Node.js) – Try It Online")
### Commented
We test whether all values are less than the length \$N\$ of the input array and make sure that there is no duplicate. Both conditions are satisfied iff the array consists of all values from \$0\$ to \$N-1\$.
```
a =>             // a[] = input array
  a.every(x =>   // For each value x in a[]:
    (a[~x] ^= 1) //   ~x is -x - 1, which is guaranteed to be negative
                 //   Therefore, a[~x] is a property (such as '-1') of
                 //   the underlying object of a[], which can be safely
                 //   used to store values that were already encountered
                 //   If a[~x] XOR 1 is not equal to 1, we have a
                 //   duplicate value
    / a[x]       //   We also make sure that a[x] is defined, which
                 //   means that x < a.length
                 //   The possible cases are:
                 //     1 / n, n > 0 is a truthy number  \__ success
                 //     1 / 0 is +Infinity (also truthy) /
                 //     1 / undefined is NaN (falsy)     \
                 //     0 / n, n > 0 is 0 (falsy)         |_ failed
                 //     0 / 0 is NaN (falsy)              |
                 //     0 / undefined is NaN (falsy)     /
  )              // End of every()
```
[Answer]
# Julia 1.5, 6 bytes
This is a built-in, so it's quite easy for Julia
```
isperm
```
Use it like this: `isperm([6,3,8,12,1,10,4,2,7,9,5,11])`
[Answer]
# [Zsh](https://www.zsh.org/), ~~18~~ ~~12~~ 11 bytes
```
>$@<{1..$#}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724qjhjwYKlpSVpuhar7VQcbKoN9fRUlGshIkttbGxU7CHsm-rRZjoKxjoKFjoKhkZADEQGOgomOgpAjrmOgqWOgilQyDAWahoA)
Outputs via exit code: 0 for a permutation and 1 for not a permutation
Explanation:
* `>`: create files called
	+ `$@`: each command-line argument
* `{1..$#}`: range from 1 to the number of command-line arguments
* `<`: try to read from each of those numbers as a file
If any command fails, then that means one of the files in the range didn't exist, so it's not a valid permutation, and zsh will exit with status 1.
[Answer]
# [R](https://www.r-project.org/), ~~26~~ 24 bytes
-2 bytes thanks to pajonk.
```
all(seq(x<-scan())%in%x)
```
[Try it online!](https://tio.run/##VVLRSsNAEHzvVxRByMEKud27XAL66hf42JdSLAoloq1QEb@9zmzSi9KQ5nbndnZn9uOyXz@s95/j7vT6Njbn8H3cbceHGgjr82V7ODTH5/fmfH/HZBPC7et4ew6Xn9Vqtz01N08fn6eXr814E1b7ZtfEMP@Lzl8qS8xq1GRB4AuZJFk6KdLLILGVGCVWgPqxRaYHogMysVat3OHUC2FEJWQKsBm3rhWAKBKTxCxKrA5i@IxezFCNtNaJ4sFJRcmkrZiJDSxtrWiRhLd3k/DMfHEAoYINDEBL7MWQBfUk0WbcjI/bw/F5kmlSpY5WRfgjU5XOqlxL7K@M0YW43kwU1Ymvsiqmy/OZA2UXGlPPsYwYa3R495WDclLi4tHFKNeK4rm8C8@/X41mGmnUqtTK0amUPbQs3S0LkVzqnioanaMbkBE@TJcydVWKTQ8GGjCwt0JDaZS6eZlG925ES@emmZVDcoc6EtNBoK8DgFTdaxQybgRzvIIDeiqsy91K3pv4bhjnI7HfBaVRFPChdscBkrdqPotPNG@OEV9CuPwC "R – Try It Online")
If input is of length at least 2, `seq(x)` outputs the integers from 1 to `length(x)`; if input is of length 1, it outputs the integers from 1 to `x`. Return `TRUE` iff all those integers are elements of `x`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 21 bytes
```
->a{a|[*1..a.max]==a}
```
[Try it online!](https://tio.run/##XZDBDoIwEETvfAWJNzMSdrdAOeCPEA41gZMmRiXRqN@Os3Az2TTtdrpvprf59Fqmbjkc0zt9@r0URSou6Tl0Xfou13zqe4HCUCEMQ77LH7d5zLZ@DWsgAVJBDRHawrgV1FRbgEWwU0NZPCk0ooGWMIO1EI4toQ0CV4UIAosbSAlpSdUKQgLVkAjjbfbnwSnmIOrI5gzyKCSJxmq3xpfq45zSOoJkp9KyW9HVXuVR4ooq3VvjCTxK8JlMKptHqrdvmNL5PmbLDw "Ruby – Try It Online")
-1 byte thanks to ovs!
-3 bytes thanks to Razetime!
[Answer]
# [Factor](https://factorcode.org/) + `math.unicode`, ~~24~~ 23 bytes
```
[ dup length iota ⊃ ]
```
[Try it online!](https://tio.run/##VVJBTsMwELz3FfsCVO/aTgIPQFy4IE6IQ1UCVEBaSnpAiBM3nslHyswGEqeNImc9nt2Z8f1q3W/3x@uri8vzU3lq9137LC@r/vHk0G3W27tW3trXQ9ut2zfZ7du@f9/tN10vZ4vFx0Lw@5ClfI6rMK7DrK7Fjs5wXKuYREmSpZJaGgkoFkyBhQY7FRAJSHO@iT/huyKOMMNWBjjy1MiRxLIE7EVRgrUWw3I58JkYOxuI8OALM7FZAB2Gq8mtjWgWw9vniXiGhqGmBLQDXjlZJbbEGJMThZJJ9tyeCayFUTqzU2e2mRv5/21upM1sDZAWxwr1RLeaov@rEVVyJbyroh8tpdHZ62VgyVmqP5dtpqj8T/UIHJyBablUxKaBMzdkS0UL5qGMBJaa54hk4CkyGU5FmhzoPPOoGUZNgzLDZWjBg4wMvfJUGqY4GKDUyyuWZAgzMPKxd0UacIDJ6JTv8sySQ2US80Yah2Mi6nH7tVI/i55Gc9AQ7IkKos@qLsYl/V0jJT6j9@fxRu4OO3luu4f@UTbbfiU/319ye3xZ7eTk@As "Factor – Try It Online")
0-indexed to save a byte. Is the input a superset of \$[0..|input|)\$?
[Answer]
# [Python 3](https://docs.python.org/3/), 33 bytes
```
lambda x:max(*x,len(x))^len({*x})
```
1. Check uniqueness: len(x) = len(set(x))
2. For unique set: max(x) == len(x) iff x = 1...n
[Try it online!](https://tio.run/##VVHRasMwEHv3V@RtSTlGfGfHyaB/MgYtW2kgbcOWsYyxb@@ka19GUzvnU6STPH8vx8vZroft83Xanfavu2p9Ou3WerPK9Hau16Z54f6zWX@b69dxnN6q@BSq8TxX22oaP5b6tJvr8bwIzz6Xunn8mKdxqR/koWmaUM3vaNb7y2WqD8DNOLzGEEWDCnfDmwlr/FElydJJkV4Gia3EKBEt9ZcWZz16HTCJX4Khw94LAewnnBWgMvAholckJolZlCgdxPAancDAQBHrRPGgUlGyaytmYgNJrRUtkrD6BAnPXSkOkFLoQAFoib0YuoHDwopbg0WDOe43o9HHjiHRMMBcFbPkQOHs9jFdyKiI7bCC103ScvGaYbkDWnK7ZPr3Q50ZoHHqAoboZEr@lhQdY09utKcHY2LMAiaQwg2e6UpplQkMtD9QvTBOxqQeXWbMvcfQMrebE6UB3lpHSeYHdAqQU88YFMab4CnBKDBNISNvM/lU4ndidENJ/xZiRttQAmvH0ZMPae7CvdxvzIgvfw "Python 3 – Try It Online")
[Answer]
# [Zsh](https://www.zsh.org/), 13 bytes
```
: >$@<{1..$#}
```
[Try it online!](https://tio.run/##BcFNCoAgEAbQq3yQhAZKY/85WJcR2rTJVolnn9778iXaFP3c6EJOL2ySHVGdXMg51VQxPrY2MLM6KmYMWEEeBOoxwmPBhglE8gM "Zsh – Try It Online")
```
:              noop command to prevent hanging while waiting for input
  >$@          create a file for every argument
     <{1..$#}  read every file between 1 and the number of arguments
```
Since the redirects are handled left-to-right, we create the files before trying to read them. If we encounter a number for which no file exists (for example on `zsh x.zsh 4 1 2`), we get the following error:
`no such file or directory: 3`
and receive exit code 1. If it was indeed a permutation, we exit cleanly with code 0.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
Ṣ⁼J
```
[Try it online!](https://tio.run/##VVK7VQQxEMtdxj5CBZ4Z/7YFCqADEt41QAgJfRATkvAgo5K7RhZp7hLe7dkeWyuN5H16PJ2ej@P89X55@bk/zt@fD79vd5fXj@PYts2KwYtDc3AVUM0/q4aOgYmFHVZhBuOR56Jyb/FsENP0JhkG5wUBdN64N4nqxBfj2YQ1WIcL5TuCS0uCIINEYsD5sHK42L0iArGLNCp8onHMDhqfm5LtlHLqUIFo2ELwtKhZWklrtBg0p/lq1LJtK02GCdbo7KUXCfe0z@5KZyXs4EjeNCnLM2uFlQ5kKe2K6d@PdVeAoa4nGSzJXPxVFEOxtzS65CGUmLKgCaZwhXe5cllVArvs71KfilMxeUbXFfPKGKpyuzpxGdCtDUkqP6JboZxnxqQI3YR2BWbBbqYYdZstu0LeSciNJPNdioVsU4msQ623bDLSRXq53VgIP/nF/QE "Jelly – Try It Online")
```
Ṣ⁼J   Monadic Link
Ṣ     1-chain: sort the input
 ⁼J   2,1-chain: is (the input sorted) equal to (range on the length of the input)?
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 3 bytes
```
o~⟦
```
[Try it online!](https://tio.run/##bVJLSgNBEL1KM@uJTFd3z2ejBwlZRPGzCASiEiRGMILozhu4060Iblx6k8xFxqp61TELYYburu@r9@p4MT25uJnNz2kY9Zv77dfLz@dqWbjRoSuWR6v@8aPfPPRP78XV4vr0oLiV69l0dsn39fb7ec0Jw/yuf30bhvHYT0o39qUjOal0@R3MxGf2yqmOWLpUurp0Tena0nUcUvHPfo9AslelzlYDa02KqGx9an21kqdtJCGqu9HMJHW0okSyzbPXs5WQRhwT5Olz/SANgCmwheQXE5ck4CDuETg9dGgb@E1sj3Ia8Cj/HyTfKSYSOAIiKGzP9YIEKnOY22jakWikBmMyv/f49ZkTzYlg24riSjpYEgMmSFkEmVrMSc2oVOultV4gGLw32ZP1rHOpdo/y3PifzzwJigdQ1Vgnb70JyCp0qvMWRSO9BYUhIVs0Eg5Fm1whgVoC7ypLB0k6YG@gvwpJpnHCfrSmTgV9d2QRyNGlrAFPtZZ0nViAkW2HFA/YKML6SLpYZIQGHXVjo02DQNsHW0@yigIrgF6BJG1rEBBtxGB8GC@7RQwo0Ewmvw "Brachylog – Try It Online")
0-indexed. Succeeds or fails.
```
o      The input sorted
 ~⟦    is the range from 0 to something inclusive.
```
Note that this can not be golfed to `⟦p` with reversed input, as it fails to terminate for cases it should reject:
```
⟦     Choose an integer. Is the range from 0 to it inclusive
 p    a permutation of the input?
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 3 bytes
```
UIS
```
[Try it online!](http://pythtemp.herokuapp.com/?code=UIS&test_suite=1&test_suite_input=%5B0%5D%0A%0A%5B0%2C+1%5D%0A%0A%5B1%2C+0%5D%0A%0A%5B0%2C+2%2C+1%5D%0A%0A%5B2%2C+0%2C+1%5D%0A%0A%5B0%2C+1%2C+2%2C+3%2C+4%2C+5%2C+6%2C+7%2C+8%2C+9%2C+10%2C+11%5D%0A%0A%5B11%2C+10%2C+9%2C+8%2C+7%2C+6%2C+5%2C+4%2C+3%2C+2%2C+1%2C+0%5D%0A%0A%5B5%2C+2%2C+7%2C+11%2C+0%2C+9%2C+3%2C+1%2C+6%2C+8%2C+4%2C+10%5D%0A%0A%5B15%2C+36%2C+13%2C+14%2C+22%2C+7%2C+28%2C+34%2C+20%2C+5%2C+4%2C+33%2C+37%2C+8%2C+35%2C+25%2C+23%2C+31%2C+27%2C+6%2C+19%2C+32%2C+38%2C+11%2C+29%2C+26%2C+39%2C+21%2C+10%2C+40%2C+41%2C+0%2C+9%2C+18%2C+1%2C+24%2C+16%2C+12%2C+2%2C+17%2C+30%2C+3%5D%0A%0A%5B1%5D%0A%0A%5B11%5D%0A%0A%5B0%2C+0%5D%0A%0A%5B0%2C+2%5D%0A%0A%5B1%2C+2%5D%0A%0A%5B2%2C+2%5D%0A%0A%5B1%2C+0%2C+2%2C+1%5D%0A%0A%5B0%2C+3%2C+2%2C+0%5D%0A%0A%5B3%2C+0%2C+1%2C+3%5D%0A%0A%5B0%2C+1%2C+1%2C+4%2C+4%5D%0A%0A%5B0%2C+2%2C+2%2C+2%2C+4%5D%0A%0A%5B7%2C+6%2C+4%2C+2%2C+3%2C+0%2C+5%5D%0A%0A%5B4%2C+6%2C+0%2C+3%2C+5%2C+0%2C+7%2C+2%5D%0A%0A%5B5%2C+2%2C+4%2C+3%2C+6%2C+0%2C+7%2C+0%2C+1%5D%0A%0A%5B5%2C+4%2C+2%2C+7%2C+1%2C+6%2C+8%2C+3%5D%0A%0A%5B0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%5D%0A%0A%5B0%2C+4%2C+8%2C+12%2C+10%2C+6%2C+2%5D%0A%0A%5B13%2C+5%2C+11%2C+3%2C+9%2C+7%2C+15%2C+1%5D%0A%0A%5B33%2C+32%2C+37%2C+16%2C+34%2C+10%2C+35%2C+30%2C+27%2C+13%2C+5%2C+14%2C+17%2C+1%2C+18%2C+39%2C+28%2C+40%2C+8%2C+0%2C+26%2C+22%2C+19%2C+31%2C+25%2C+24%2C+36%2C+7%2C+12%2C+29%2C+38%2C+6%2C+4%2C+2%2C+20%2C+3%2C+10%2C+15%2C+9%2C+21%2C+11%2C+23%5D%0A%0A%5B37%2C+26%2C+19%2C+22%2C+30%2C+5%2C+1%2C+23%2C+20%2C+30%2C+32%2C+6%2C+25%2C+11%2C+13%2C+16%2C+2%2C+1%2C+27%2C+30%2C+4%2C+22%2C+27%2C+26%2C+36%2C+31%2C+6%2C+38%2C+21%2C+5%2C+34%2C+41%2C+18%2C+2%2C+34%2C+16%2C+34%2C+39%2C+21%2C+12%2C+26%2C+6%5D%0A&debug=0&input_size=2)
[Answer]
# [R](https://www.r-project.org/), 27 bytes
```
any(rank(x<-scan(),,'f')-x)
```
[Try it online!](https://tio.run/##VVNNb5tAEL37V6zSQ0AaS@wXC1UuvVQ99NSmh0q9IGSiqClEmCquqv52970JXhyDMDs7897Oe8N8fmde5u75@TCbYZrNse/GohTTPT1NL4/jg1kmsxyOi/k1zQfTd8fDcTeYu70Zfo/98jiNxan8uzNa9yZcns7d@KeYu/Fncbrbr7hyO9yW@1N5/rfru6W42eN3/@Xb/afv73@MN@VuKPrCluu/uPXNyRbzOeply8AbdoJEqSVJI63YSqwVmxOcLivsNMiokRmIlZFrrBphGrMCdhJyI6ouCMhIYoPYKI65rhWPV6tgHmik9bU43Fg5cWRylXgvviW0r8QlCXjqaQLulc@2IHRgAwOyxTbisQvqTaePHz5/vZJp6yxrcKVSVs5ntbbYtYpWdbhUBmqqvBdVHZqL65r9RNUZTa@xiBgxajybzEE1qXDS6OaTSkXtVN2N582Vo5E@ekqVMrJVKsczVISut3kIqnRDET2NoxlQETa8FkXK6qg1LWipf8uzJfpJn5x6F@lzoz5UNO61Z8cmOUI1iWkgsi8NgNSp1QDyHAjusQQLnCkRl6MV9Gyio@HZH4m1FpSeooAP2DUbCHpUr71oR@vgeOanqw@CFy06/wc "R – Try It Online")
Returns FALSE for Truthy, TRUE for FALSY (just to shave one byte)
**Explanation:**
If the array containing the rank of each value is equal to the input array, then it's a permutation of `1..n`
**Note:**  
5 bytes are wasted because in `rank` function the default handling strategy in case of ties is "average their ranks" instead of any of the other possibilities... argh!
[Answer]
# [Perl 5](https://www.perl.org/), 38 bytes
```
sub{!grep!{map+($_,1),@_}->{$_},1..@_}
```
[Try it online!](https://tio.run/##dVNda9tAEHzPr1AOUWyyDbovnWST1k99KTQveUuLSSBu06a2UZyHYvLb3Zm1rFMotYy4292buZ1ZbR@6p3goV1eH55f7/fn37mF7vv99t72YlEuxU1ksX99/2JfLV7GXl9gc5meLXfey@/HnanJW4Hdrv0m/EHdaOhlFfY57GRVhiVyQKLUkaaQVW4m1YnOF032FVIOSGqWBcBm9xrYR1rEsIJVQHHFswEBJEhvERnEsdq14LK3CeeCR2dfi8MfOiSOXq8R78S2xfSUuScBb7xPw7wltC0YHOjCgWmwjHtmeewqtVndPz4NUo8ayCGOlsn4@SzaKvhHTqhjD8UBtB25V16HDODaCzxBgm1EdgBanYESQwDXeTaamzhQ/aXhkoopIVVX4EfubJ4cjbfaUMWV0q3yON6kIX48mJqgPDSX29JVWQWOYdDwVKbqjEzSopTstL5joNl106mzkFDTqUkVbj607tsoRq8lMe1E9NAFWp5MAJM95YZJnsMGlEoE5ekEvJzo5ni2SWc@C01MZEAK8ZgdB7@q1GW2pnyvP@pQnZ9s9rneFudFvbfZ1bebFMfSuXE0W5XL60Wx@FWZmvlzfFNefCyM/N4/riREjzIrBkWK16fqvdQD8xIE84v0DeIKaKfT/AHWk54e/ "Perl 5 – Try It Online")
[Answer]
# [Red](http://www.red-lang.org), 46 bytes
```
func[a][i: 0 until[alter a i: 1 + i]single? a]
```
[Try it online!](https://tio.run/##bVJBbttAELv7FUSuvWhndrWSgaJ/6FXQQW2U1oDrBq5z6OtdcpIi1aqwIFiznCF3yOv6eP@8Pk7z4Xm9/jjen14uX6dlnk5HdHi53E7naTnf1isWsJTwAac54SPO6@Xb7fsnLPP9@frzywq1Y0qc8@8nbFsw7BDeYhy7NhaIyyjoUTFgROqQElKLs6h2BAwE9mzIImhZexYHCC1wJqCypbC5mUdgRcpIBaYWG@H8m2K0c7a0eA/jwy@Didc6uMNHMXgHq8h8h7bM5402jeQ1kpKBaKQBztO/Ch6elvOv38eH7f7a@7Z72q@3NcDbbe8Q//EkxR6b4VlGvQt@t8q4nLItay0lPOTutkeFR5rf8z20auSUTKxxuAtG2CBfwsCdlM2vPSyKkcuU2rKmUGNS24m232U0h8ODzHPlRiGge7T/tbfITpPHsn6U76PkV@VI@bDITFG@hvC/U2Bel2Rah4Lci1/BIbq5HLktksZ5rjwKok5@UFrVeAU8h0REMl2XFn/0ktm1N9KSotc9cij2uFJc7C23LnydD4f7Hw "Red – Try It Online")
increments a counter as long as the counter is found in the list, and then checks it against the length.
`1 = length?` is used as a polyfill for `single?` in the latest Red version.
-5 bytes from tsh.
-5 bytes from Galen Ivanov.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 43 bytes
```
a->a.sorted().reduce(1,(x,y)->y==x?x+1:0)>0
```
[Try it online!](https://tio.run/##bVFdb9MwFH3Pr7AqTUrgNortfLQdLQKJhz0gEOMN8eC1zshokypxyia0317uuQ0SSFM@7Pvhc@45fnAnN3/Y/Tw3h2PXB/XAcdp06avr6N/MGJr9i7l6bLeh6doXi0PovTugFG33bhjUR9e06nek1HG82zdbNQQXeDl1zU4duBbfhr5p7799V66/HxJpVepz73fN1gX/5qYNt4K5UbVan91849KBOf0uTlLuGrc@1hQ/0lMy3zyt149vH1/rVZZssvO1QLX@l3o/1rXn5i/e7XwfI3XTHscJecrePg3BH9KmTZJ037R@YIK66z@47Y8YsZpvpumUOrleBT8EtVbv@t49DZNwaUyH474J8YxmjHRwx68di4j58/e@X61Obj/6T3WShk7Oxsn1hDpN0I0hPbIpoY5nV8NKXd1dtTP6SxS6i2Mx@BNSdYpN/P8YUksm4GdZn6Pns440mcgQVss7S4j54yingkqqaEFL0hlpTZpLRjYZ5xZcK7knx0lGKHldEBpQzzlXcVfB/ZHmWkU6J12QQZdZkuWtFgDLCCCxJRl@OTJkgG4yspbsEqA2I1NRzn@ZIOd3YtJLpjLMwwzcTXpBlqsRhmUpIo0lWhaH9SJUy9g6yiGYm/E3PEshRuApIoxQiBE8Z1RwhFMl/5lB5EJ8JTFsEy0QJ8KB@d/DcQErLeavGEELmAF@BogSF5CL5AXUWHgHV1gO@3FpL6DPQDS8WMKIJdgrGAvDjJhYwPCFGJLBwYsSAwG4vxKUcJK784jpjLjNEBZ3giyaOeBpKiDiXnOZiuR2LNSAUs4ymYVsZmLUEqPnMqQVFaJlujuL/uoP "Java (JDK) – Try It Online")
## Explanations
This answer is a `Predicate<IntStream>` and requires that the input contains no `0`.
First this code sorts the input stream. The reduce method then makes sure that each consecutive number is encountered, and return the last encountered number. `x` always contains the next expected number, or `0` if we got an unexpected number. `1` is the first parameter of the `reduce` method as it's the first expected number. Given that `0`, or any negative number, is not allowed in the `IntStream`, when `0` is returned for the first time, it will always be returned for the remaining of the process.
[Answer]
# TypeScript's Type System, 450 442 bytes
```
type A<T extends any[]>=T extends{length:infer L}?(L extends number?L:never):never
type B<L extends number,T extends 0[]=[]>=T extends{length:L}?T:B<L,[...T,0]>
type C<N extends number,T extends number=1,R extends any[] = []> = R['length']extends N?R:C<N,A<[...B<T>,0]>,[...R,T]>
type D<T extends any[],U extends any[]>=T extends[]?true:T extends[infer H,...infer R]?H extends U[number]?D<R,U>:false:never
type F<T extends any[]>=D<T,C<A<T>>>
```
[TypeScript Playground Link](https://www.typescriptlang.org/play?#code/PTAECUFMDNIJ0gOwMaQM4C5QAsAuuAHTEAS10UgA9cA6Ege2BIFsCAbSZpXExAcwC0AQzhlsXHsgEB3MbwG4AngXTJRBXGgXLIAtIrS5OwgIwwTAFgAMQgGzR7AKCUrQAQQA8AFVBUjiABM0UCFERQBtAF0APgBeHz8kIIBvDn5cbAxeWDhQABkAXwB%20AAo832ok4MQAV2YAI3givIwKADd4AEpWyA64Zx1QACEPcsTA6rrGuAAaBMqJ0Cso2Ki4%20f8UtL4MjEKirwwRvJnwmnOvGasYgdcAYQ8AOQrNyYb4OZeq0Fr3uFiTDNwF9FqEIpFQLFQGtIRBwgBybYZeGRcZBUCPIrgDAPR4zTxnc4jLzRK4xU7nGjgOY3FyQUAAEW8IPRNUQAGtEPRpIgojMAKos4Jsznc3kxeJCqJFXBwGqQDAbKrhbLwUAACRmlNVuXAkSK6qFoH54V%20031TOp-OiGGgQjYaAV7Xgt3pADFmWjgmC1rEmZcHp4SdFoo5XaAvOhcCZYQ8TFZQyBQMmAHpFMN0iNRgBMsI94UBoGzM1AAGYSxYS7YSwBWG5J1Pp8ORwylvMeAsl4tlisl%20O1%20tgRsZwYt3AWdtrRwN0BpkeuMc1yeF7vl0CV0A1qslgDsJYAHIPk7OikA)
## Explanation
```
// This allows getting the Length of any tuple via inferring its L property
type A<T extends any[]>=T extends{length:infer L}?(L extends number?L:never):never
// This creates a tuple of arbitrary length L (we need to use this later for arithmetic)
type B<L extends number,T extends 0[]=[]>=T extends{length:L}?T:B<L,[...T,0]>
// We can use this to generate an incrementing tuple of length L (e.g. [1, 2, 3, 4]). We use this to compare against the final array.
type C<N extends number,T extends number=1,R extends any[] = []> = R['length']extends N?R:C<N,A<[...B<T>,0]>,[...R,T]>
// This checks if two arrays have the same elements inside them 
type D<T extends unknown[],U extends unknown[]>=T extends[]?true:T extends[infer H,...infer R]?H extends U[number]?D<R,U>:false:never
// Finally, we can use this to compare the chosen array T vs the increasing tuple N
type F<T extends any[]>=D<T,C<A<T>>>
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/mathematica/), ~~22~~ 20 bytes
```
Sort@#==Range@Max@#&
```
-2 bytes, thanks to @ZaMoC:
[Try it online!](https://tio.run/##VZJNasNADIX3uUagK0E80vx5YfAFCqU9gSkhzSIpBC8KIWd339NMCsXG9mg070mffFnWr@NlWc@fy3aato/v2zrvp@l9uZ6O8@vyM@9ftrfb@boe5tNhvu/u4SF4iPKl0lfW1iZ9Ay/EoiTJUqTKKGGQECS0XfXvAeGK7Yy0SImmlvFZhTlMiQgXJCYc8bPYLhKihCTKRB3F8BlcxqBDN8uiuLFSUXroIGZiI3VtEC0S8fQ6Iu5uFka4KazggGwJVQy78EWvrfLW3bPtBsFa7331RyN4V54aCcaFHI2i1PQkx8sXrDM5NjTDQEKAIhnP2uQJh7SKhzpt75wonFR3@Xe1UOIcjD2XphZcW@k4UC73MUaHVcnBCJ48AQIk24lEMkpcpDgS4chiCkdC1Or4E0dVHeVA9q09ZUucf6YrZ4BsLxqO6qOCinGg3GA@FiioUJT/RfTCxEdrbIuufhZ@Rgowg3Bm9dHrNG/E2@mDN@aXx@6xbb8)
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 5 bytes
```
c%R|}
```
[Run and debug it](https://staxlang.xyz/#c=c%25R%7C%7D&i=%5B1%5D%0A%5B1,2%5D%0A%5B2,1%5D%0A%5B1,3,2%5D%0A%5B3,1,2%5D%0A%5B1,2,3,4,5,6,7,8,9,10,11,12%5D%0A%5B12,11,10,9,8,7,6,5,4,3,2,1%5D%0A%5B6,3,8,12,1,10,4,2,7,9,5,11%5D%0A%5B16,37,14,15,23,8,29,35,21,6,5,34,38,9,36,26,24,32,28,7,20,33,39,12,30,27,40,22,11,41,42,1,10,19,2,25,17,13,3,18,31,4%5D%0A%5B2%5D%0A%5B12%5D%0A%5B1,1%5D%0A%5B1,3%5D%0A%5B2,3%5D%0A%5B3,3%5D%0A%5B2,1,3,2%5D%0A%5B1,4,3,1%5D%0A%5B4,1,2,4%5D%0A%5B1,2,2,5,5%5D%0A%5B1,3,3,3,5%5D%0A%5B8,7,5,3,4,1,6%5D%0A%5B5,7,1,4,6,1,8,3%5D%0A%5B6,3,5,4,7,1,8,1,2%5D%0A%5B6,5,3,8,2,7,9,4%5D%0A%5B1,1,1,1,1,1,1,1%5D%0A%5B1,5,9,13,11,7,3%5D%0A%5B14,6,12,4,10,8,16,2%5D%0A%5B34,33,38,17,35,11,36,31,28,14,6,15,18,2,19,40,29,41,9,1,27,23,20,32,26,25,37,8,13,30,39,7,5,3,21,4,11,16,10,22,12,24%5D%0A%5B38,27,20,23,31,6,2,24,21,31,33,7,26,12,14,17,3,2,28,31,5,23,28,27,37,32,7,39,22,6,35,42,19,3,35,17,35,40,22,13,27,7%5D&m=2)
Explanation:
```
     ; Implicit input onto top of stack
c    ; Copy top of stack
%    ; Length of top of stack
R    ; Make range [1 .. n]
|}   ; Compare top two elements of stack. Arrays are different orderings of same elements?
     ; Implicit output of truthy/falsy
```
Could probably save a byte somewhere.
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 1.5 bytes (3 nibbles)
```
-,,
```
Returns an empty list (falsy) if input is a permutation of 1..n, or a non-empty list (truthy) if it is not.
```
-       # remove 
 ,      #   sequence of 1..
  ,     #   length of
        #   (implicitly) input
        # from
        #   (implicitly) input
```
[![enter image description here](https://i.stack.imgur.com/UJwUg.png)](https://i.stack.imgur.com/UJwUg.png)
[Answer]
# Python, ~~43~~ 39 Bytes
```
lambda x:sorted(x)==list(range(len(x)))
```
0-indexed. Uses `sorted()`, `range()` and `list()`. Surprisingly gives correct answer for empty list.
[Test on TIO.](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCqji/qCQ1RaNC09Y2J7O4RKMoMS89VSMnNQ8opKn5v6AoM69EI00j2kDHUMdIx1jHJFZTkwsuaggVNUURNQGJ6FjomKOJglQa6higiAI5/wE)
[Answer]
# Python, 39 Bytes
```
lambda x:sorted(x)==list(range(len(x)))
```
I am an account owned by PlaceReporter99. I am trying to get 20 rep so that I can access the chat rooms.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 6 bytes
```
¬⁻Ｅθκθ
```
[Try it online!](https://tio.run/##BcFLCoAgFAXQrThUuIH2j9ZgNBcH4iRJLM3a/uscf7jiLxeJ9hJS5dtVuQ7pfbh2N89gpwDLQoiVyJgBLSYoBYkFHRRGzOihpLXUfPEH "Charcoal – Try It Online") Link is to verbose version of code. 0-indexed. Outputs a Charcoal boolean, i.e. `-` for permutation, nothing if not. Explanation:
```
   θ    Input array
  Ｅ     Map over elements
    κ   Current index
 ⁻      Remove values found in
     θ  Input array
¬       Check that nothing is left
        Implicitly print
```
(Mapping over the input indices is golfier than creating a range.)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~40~~ 38 bytes
```
s=>s.sort((a,b)=>a-b).some((x,i)=>x^i)
```
[Try it online!](https://tio.run/##DchbCoAgEADA6@zCJr3/7CJRoKVhWBtuRLe35nN28xhZUrju4uTVZa@z6EGUcLoBDFnUgyks/nE4gJfCH@8cMC98CkenIm/gYSypopo6aqmnZkLMHw "JavaScript (Node.js) – Try It Online")
Returns true for invalid and false for valid. Put a `!` before the `s.sort` for the otherway round. Takes input 0-indexed.
[Answer]
# [jq](https://stedolan.github.io/jq/), ~~20~~ ~~49~~ 36 bytes
```
length==max and max==(unique|length)
```
[Try it online!](https://tio.run/##yyr8/z8nNS@9JMPWNjexQiExL0UBSNvaapTmZRaWptZAJDX//4821DHVsdQxNNYxNNQx1zGOBQA "jq – Try It Online")
*Thanks to `tsh` and `xigoi` for catching mistakes in the previous attempts...*
Third time is the charm perhaps?
Since the rules limit the numbers to "positive integers", there's no need to test the minimum. Making sure the largest number in the list, the size of the original list and the size of a de-dup'd list are all the same is sufficient. So that's what this version does.
[Answer]
# [Raku](http://raku.org/), 14 bytes
```
{$_∖bag ^$_}
```
0-based.
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiX@Uce0pMR0hTiV@Nr/xYmVCkoq8Qq2dgrVimkKQCElhbT8IoVoAx0jHcNYnWggqWMApA2gpCFQ3FjHVMdMx1zHItb6PwA "Perl 6 – Try It Online")
* `$_` is the list argument to the function.
* `^$_` is a list of numbers from 0 to one less than the size of the input list.
* `bag ^$_` is a bag (a set with multiplicity) of that list of those sequential numbers.
* `∖` is the set difference operator. The left argument, the input list, is coerced to a bag because the right argument is a bag, from which one instance of each of the sequential numbers is removed. The result will be an empty bag only if the input list contained exactly one number from zero up to one less than its size. An empty bag is falsey in a boolean context, and a non-empty bag is truthy.
]