SubsetQ

SubsetQ[list1,list2]

yields True if list2 is a subset of list1, and False otherwise.

Details and Options

  • SubsetQ tests for non-strict subsets, and yields True if the listi are equivalent.
  • SubsetQ does not account for multiplicity of elements.
  • SubsetQ[list1,list2,SameTesttest] applies test to each pair of elements in the listi to determine whether they should be considered the same.

Examples

open allclose all

Basic Examples  (1)

Test if a set is a subset of another set:

Properties & Relations  (2)

The empty list is a subset of every list:

Every list is a subset of itself:

Wolfram Research (2014), SubsetQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetQ.html (updated 2022).

Text

Wolfram Research (2014), SubsetQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetQ.html (updated 2022).

CMS

Wolfram Language. 2014. "SubsetQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/SubsetQ.html.

APA

Wolfram Language. (2014). SubsetQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubsetQ.html

BibTeX

@misc{reference.wolfram_2024_subsetq, author="Wolfram Research", title="{SubsetQ}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SubsetQ.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_subsetq, organization={Wolfram Research}, title={SubsetQ}, year={2022}, url={https://reference.wolfram.com/language/ref/SubsetQ.html}, note=[Accessed: 21-November-2024 ]}