[Question]
  [
A superpowerset (analogous to [superpermutation](https://en.wikipedia.org/wiki/Superpermutation)) on \$n\$ symbols is a string over the alphabet \$\{1,2,...,n\}\$ such that every subset of \$\{1,2,...,n\}\$ appears as a substring (in some order). For instance, `12342413` is a superpowerset on four symbols because it contains `1`, `2`, `3`, `4`, `12`, `13`, `41`, `23`, `24`, `34`, `123`, `241`, `413`, `234`, `1234`.
The lengths of the shortest such strings and some examples are given in this sequence: [A348574](https://oeis.org/A348574)
## The Challenge
Given a string composed of \$n\$ unique symbols (and, optionally, \$n\$), output whether it is a superpowerset on \$n\$ symbols.
## Rules
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest answer in bytes wins.
* Assume only valid input will be given.
* Assume \$n\$ is greater than \$0\$
* Input and output can assume whatever form is most convenient, e.g. the series of symbols can be a string, a list, an integer, a set of n bitmasks, etc, so long as it is indicated in the answer. Additionally, anything may be used as a symbol provided it is distinct from all the other symbols.
## Test Cases
```
In: 1234
Out: False
In: 1
Out: True
In: 11111111
Out: True
In: 123
Out: False
In: 1234512413
Out: False
In: 12342413
Out: True
In: 123424133333333
Out: True
In: 1234567214573126431523674256147325716357
Out: True
In: 122331
Out: False
```
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ŒPḊfƑɓẆṢ€
```
A dyadic Link accepting the alphabet size, `N`, on the left and the candidate string, `S`, on the right as a list of integers that yields `1` if the string is a superpowerset of that alphabet size.
**[Try it online!](https://tio.run/##y0rNyan8///opICHO7rSjk08OfnhrraHOxc9alrz//9/k//RhjpGOsY6JkDSRMdQxzgWAA "Jelly – Try It Online")**
### How?
```
ŒPḊfƑɓẆṢ€ - Link: integer, N; list of integers, S
ŒP        - powerset of [1..N]
  Ḋ       - dequeue - removes the empty list
     ɓ    - new chain with swapped arguments:
      Ẇ   -   all sublists of S
       Ṣ€ -   sort each
    Ƒ     - is the dequeued powerset invariant under:
   f      -   filter keep the sorted sublists
```
[Answer]
# [Python](https://www.python.org), 90 bytes
```
lambda i,n:f(*i)+2>>2**n
f=lambda a,*i,k=0:1<<(l:=k|1<<a-1)|(i>()and(l>k)*f(*i,k=l)|f(*i))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=XU9RasMwDP3vKfQTLGcOzI4HJdQ-yNiPS5vOxHFD7MIGucl-AmO7yE6x28xJnZ89kPQkPUno43t4j69XP39e1MvXLbbV_vfZmf54MmCZb1osLX0QWouy9LtW5ZZhpWWdemz44YCuUd2UiKk4ndBqpMaf0OmOlst40jk6rYtovvDTXkeI5xDBeiBc1JIwwhfLWKio714-cSH5lvyjGeuoEHUtpRBS8tQgzQ4S_K0_nscACpwNEXszoPWRrdcpXSXDmCpICr4PUGkoAoECcBEwuGBewKA3b1tC6fbKPN_jHw)
Takes a list of integers `i` and the integer `n` as arguments. Uses bitmasks to avoid lengthy *frozensets*.
Using one less layer of bitmasks might be a bit clearer, but [costs a byte](https://ato.pxeger.com/run?1=XU9LasMwEN3nFLMxkhwZIlmFYCJfJMlCIXYqLCvGUqCl7UmyMZT2Ij1Fb1NZVjZ9MN_3Zoa5fw-v_vlqp8-LPHzdfFtsf_dG9aezAk1tZRqL3_IW55p8kDWra7tqZeIVzTXt5Kbam0p272y3UwWjOdag7BmbuiNxMEgMWccV5JhO_LTXEXzjPGgLiPFSIIrYbAlzysvFiyfGBXsU_9KEOMp5WQrBuRAsEKhaQYC99admdCDBaOdxrwasrafxOiFRMoyhg1HGtg6KGjKHIAM8CyhccFpAoVcvj4IELK9M0xL_AA).
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~11~~ ~~10~~ ~~8~~ 7 bytes
*Edit: -2 bytes after inspiration from caird coinheringaahing, and then -1 byte by stealing the I/O idea from [emanresu A's answer](https://codegolf.stackexchange.com/a/242529/95126)*
```
-ṁPQ¹Ṗu
```
[Try it online!](https://tio.run/##yygtzv7/X/fhzsaAwEM7H@6cVvr///9oQx0jHWMdEyBpomOoYxwLAA "Husk – Try It Online")
Outputs a list of an empty list (`[[]]`) if a superpowerset, or a list containing nonempty lists otherwise.
```
      u       # Get uniqe elements of input,
     Ṗ        # and get all subsequences
-             # now remove from this
 ṁP           # all permutations of
   Q¹         # all contiguous sublists of the input.
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
ŒPŒ!ẇ€SɗƇƑ
```
[Try it online!](https://tio.run/##y0rNyan8///opICjkxQf7mp/1LQm@OT0Y@3HJv4/vNyl9tBSpaOTHu6cARSO/P/fREfB9L@hkbGJkYmhsY4CiGVqCGIDAA "Jelly – Try It Online")
Takes \$n\$ on the left, and a list of integers up to \$n\$ on the right
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 41 bytes
```
Length[{}⋃Union/@Subsequences@#]==2^#2&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yc1L70kI7q69lF3c2heZn6evkNwaVJxamFpal5yarGDcqytrVGcspHa/4CizLySaGVdu7RoZR3fxAqgVKxaXXByYl5dNVe1oY6RjrGOSa0OkAkmdFAgRAioBM7QMdEx1QGxTIAkijBuIVSIapSZjjmQbQhmmwPFQDJmQB6IZQpWBVIBMgqkFqQOpMoIrNoQKGIMYtVy1f4HAA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 9 bytes
```
ÞSvs?Uṗ$F
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLDnlN2cz9V4bmXJEYiLCIiLCJbMSwyLDMsNCwyLDQsMSwzXSJd)
Returns a list containing the empty list (`⟨ ⟨ ⟩ ⟩`) for truthy and a list containing nonempty lists for falsy.
```
ÞS        # Sublists...
  vs      # Sort each
       $F # Remove from...
      ṗ   # Powerset of...
    ?U    # Unique symbols of input
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 84 bytes
```
And@@(Subsequences@s~ContainsAny~Permutations@#&/@Subsets@Union[s=IntegerDigits@#])&
```
[Try it online!](https://tio.run/##VYo9C8IwFEX/ilAQhUJ5@ZwKr@jiVhAncYg11Ax9xSYdROxfj9F28cCFey@nM@FuOxNcY2JbxopuiJvjePX2MVpqrEc/7XoKxpGv6DnVdujGkPyePGbrAn9u8HiidJ19eaBgWzvsXevSm12261gPjsKqwLbAFzAucshhIU/7GyGBCZjrX1mYHaUZCKk5MCU4SMaVFkwqEJozqUFxqd8xfgA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~83~~ 76 bytes
```
->l,n{!(z=*1..n).uniq{|w|[*z.combination(w)]-l.each_cons(w).map(&:sort)}[1]}
```
[Try it online!](https://tio.run/##VY7ZCoMwFER/pX0pKjFws0LB/ohIUbsFNLEuaDV@u41oHzowcIa5cKfuss/yiJbwUiA9Hb0xCgBj7eNOq/dkexsHI85NmSmdtspor/eTsMD3NH9dc6Mbl3GZVt7p3Ji69ecYknmpDjEQyhAg2IVcXs04EAYb/sGu7UZIAoxLCkQwCpxQIRnhApikhEsQlMtk/TrZwT7iAd/UU7UN@oGrBrfiCw "Ruby – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 98 bytes
```
lambda i,s:len(f(i))>>s
f=lambda i,*t:i and{1,len(i)>len({*i})or frozenset(i),*f(*t,i[1:],i[:-1])}
```
[Try it online!](https://tio.run/##bU/LTsMwELz7K6yc7Mig5tEDRu4RqadeuIUcDHXKSo4d2S6iVP0KDlz6df2R4IRAK5WVdi3NzI5nu114tabooe2sC9jvPIp961Vw6mXrPFijoYVA7qaiCG3EU69l@7yWGJjnWhnSEKB0sfCoEX9MGjhgadb7jA0SoIvh2adwoNbhxtkPZeI/kWBpQ9LAoMp4HSe/yWp6uIwEWOAZsnE@SO0VaqKBxmDwmDWswXCEocG6mtVCJMuEgyBpKzui3qRmuip5HXUOOkIpowgrfVavEm7FoCO6mvN6ZL3iTmwIsFa@D6fddw5MIMnp@HU6fiaVFcLFqMzRfmk4zvKiRKtt4FM@NII/yKPb/gJTXeF5cb0cHedZXmb/U2fi0j7Pi6Is86utbw "Python 3 – Try It Online")
Takes a list of numbers and the number of symbols.
In python, you can't have a set of sets, instead you have to use the immutable frozenset. The algorithm is quite simple, just check every substring. To do that, you can use the vararg-sublist trick, where f is called for every sublist of the input in length order. The recursion is stopped when we encounter the empty list. This means that if this is really a superpowerset, then the resulting set will contain \$2^s\$ elements (every subset, except the empty set plus a 1). We can then use a bitshift to check for that condition.
It's possible to replace `frozenset(i)` with `(*{*i},)` for -5 bytes, but I'm not sure if the order of the set expansion is well defined.
[Answer]
# [Factor](https://factorcode.org/) + `math.combinatorics math.unicode`, 74 bytes
```
[ dup members all-subsets rest swap all-subseqs [ natural-sort ] map ⊂ ]
```
[Try it online!](https://tio.run/##hZA9TgMxEIX7PcW7ACttfiU4AKKhQVRRCq8zgMWu17HHIlHkhpJjcpFlbCTCkgKPZH3z5s0U70lpHvz4@HB3f3uNV/KWOgTiIN8@ktX0i2o6sFciDJ6NfUav@KWO1uhhR9@NHvrWWCUnjQ5wnpiPzhvLuKmqUwV5JzSYYY4F0k9/pmmlyUb6s78stJD/cvafPq3LyyushZvCa9HyZCVdpmVxZUe@l73Zl12z4m5EmRdKVRo32EWHnvqWfIDquqsQ25Kwp8AIb8qd1X3ABpJf9EoUiRlbCdbh8@Md2zFTPX4B "Factor – Try It Online")
*"Is the power set of the input's alphabet a subset of the sorted sub-sequences of the input?"*
[Answer]
# JavaScript (ES10), 86 bytes
*Saved 14 bytes thanks to @tsh!*
Expects an array of symbols. Returns \$0\$ or \$1\$.
```
a=>(g=a=>new Set(a).size)(a.flatMap(x=>p=[...p,y=1<<x].map(v=>v&y?0:v|y),p=[0]))>>g(a)
```
[Try it online!](https://tio.run/##jY3NCoJAFEb3PUW4iBmwwTu/EM70BK1ahouhRjFMJcU0encbwWVK3@Iu7jnfvXfb2eb6zOt2X1Y3N6Z6tNqgTPtZutf27FpkMWnyt8PIkrSw7cnWqNem1hdCSB0OGuK4T8jDrzttut1wjA7dZ8ChN6IEY2Myf2K8VmVTFY4UVYZSNHUDoIwH3tj8YotgziKnbAVxAZTDqvEPn7P6SCoKXCgGVHIGgjKpOBUSuGJUKJBMqKk/fgE "JavaScript (Node.js) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt) v2.0a0, 12 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
â à eÈá d@øX
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&code=4iDgIGXI4SBkQPhY&input=WyIxMjM0IiwKIjEiLAoiMTExMTExMTEiLAoiMTIzIiwKIjEyMzQ1MTI0MTMiLAoiMTIzNDI0MTMzMzMzMzMzIiwKIjEyMzQyNDEzIl0tbQ)
```
â         - unique elements
  à       - combinations
    eÈ    - all?
á           * permutations of that combination
  d@        * any?
    øX        in input U
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 53 bytes
```
Ｗ⁻⪪θ¹υ⊞υ⌊ι≔⟦⟧ηＦＬθＦＥ⊕ι✂θκ⊕ιＦ⬤κ⁼¹№κλ⊞ηΣＸ²Ｅκ⌕υμ¬⁻…¹Ｘ²Ｌυη
```
[Try it online!](https://tio.run/##VY89a8MwEIb3/oobT6AOdrJ1CqWFQlNMM5YOwlGtI2cp1kfy85WTSQsdT@@Hnnd0Jo7BcK1XR2wB9@RLwsOZKeOioVMailIwlOSwaBCZ5jIjKfX0sEuJJo9f3xqcnD8hAr5bP2WHi2TWe2/O@ObHaGfrsz1KUMOBabSt/aThv6Z@YztmFPVlKYYTdhqeQ/G5PfFqWnmcVAnLEK42Yi9w8pc4XskfG@vcnMI1RJLoR8j3cZ/GT7Z1/gXv0DJUtSkSqrXrN9t@223q44Vv "Charcoal – Try It Online") Link is to verbose version of code. Takes a string as input and outputs a Charcoal boolean, i.e. `-` for a superpowerset, nothing if not. Explanation:
```
Ｗ⁻⪪θ¹υ⊞υ⌊ι
```
Get the unique elements of the input.
```
≔⟦⟧η
```
Start collecting integers representing sets of unique elements.
```
ＦＬθＦＥ⊕ι✂θκ⊕ι
```
For each substring, ...
```
Ｆ⬤κ⁼¹№κλ
```
... if this substring only contains unique elements, then ...
```
⊞ηΣＸ²Ｅκ⌕υμ
```
... collect a bitmask of the unique elements.
```
¬⁻…¹Ｘ²Ｌυη
```
Check that all possible bitmasks were collected.
34 bytes for a specific input format:
```
ＦＬηＦＥ⊕ι✂ηκ⊕ιＦ⬤κ⁼¹№κλ⊞ηΣＸ²κ¬⁻…¹Ｘ²θη
```
[Try it online!](https://tio.run/##VY7BCsIwDIbvPkWOKVTQ6c2TiAfByXDHsUOZdS12retaffyaDhS8hCTfl590SvjOCZPS3XnAs7R9UKgYg3kuxRNPtvNykDbIG2rGoTa6k6g4PDj8M/Y92xuDRI9jFGbCNYeDizbklZmlKk4qJ9RxwMq9pceC4ojsFpXXZF5cwFLbOOFV2F7miJ83MnpCZTmlZsuhWXEgTmQzN1RpU7RtWr7MBw "Charcoal – Try It Online") Link is to verbose version of code. Uses the same algorithm, but takes an integer `n` and a list of integers less than `n` as input.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~8~~ 7 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
êæIŒ€{K
```
Only takes the string as input. Outputs `[""]` for truthy, and a list with additional items as falsey, which is allowed because of the flexible rule "*output can assume whatever form is most convenient. ... Additionally, anything may be used as a symbol provided it is distinct from all the other symbols.*" (taken from [*@emanresuA*'s Vyxal answer](https://codegolf.stackexchange.com/a/242529/52210)).  
If a truthy/falsey value was mandatory, a trailing `g` (length) could be added, because only `1` is [truthy](https://codegolf.meta.stackexchange.com/a/2194/52210) in 05AB1E.
[Try it online](https://tio.run/##yy9OTMpM/f//8KrDyzyPTnrUtKba@/9/QyNjEyMTQ2MA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/w6sOL6s8OulR05pq7/8u9umZSgoaJUWlJRmVmkqHVwM5aYk5xalATq3O/2hDI2MTHUMdQyjQAfJB2MTU0MjEEMJEYUABRI2ZuZGhiam5saGRmYmxoamRsZm5iZGpmaGJubGRqbmhmbGpeSwA).
**Explanation:**
```
ê        # Sorted uniquify the digits in the (implicit) input
 æ       # Pop and push its powerset list
  I      # Push the input
   Œ     # Pop and push its substrings
    €{   # Sort each substring
      K  # Remove those from the powerset-list
         # (after which the result is output implicitly)
```
]