Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 27, 2025

Problem

The documentation for multiple set types contained mathematically incorrect statements about empty sets:

  1. In IsProperSupersetOf methods:

    An empty set is a proper superset of any other collection.

  2. In IsProperSubsetOf methods:

    An empty set is a proper subset of any other collection.

Both statements violate basic set theory principles.

Solution

Corrected all statements to align with mathematical set theory:

An empty set is a subset of any other collection.

Mathematical Background

In set theory:

  • An empty set (∅) contains no elements
  • A proper superset of set B is a set A that contains all elements of B and has at least one additional element
  • A proper subset of set B is a set A that contains only elements from B and has fewer elements than B
  • Since an empty set has no elements, it cannot be a proper superset or proper subset of any set
  • However, an empty set is a subset of every set, including itself (but not a proper subset of another empty set)

Change Details

Fixed incorrect statements in the following files:

  1. ImmutableSortedSet`1.xml:

    • IsProperSubsetOf remarks (line 627)
    • IsProperSupersetOf remarks (line 682)
  2. HashSet`1.xml:

    • IsProperSubsetOf remarks (line 1597)
    • IsProperSupersetOf remarks (line 1679)
  3. SortedSet`1.xml:

    • IsProperSubsetOf remarks (line 1396)
    • IsProperSupersetOf remarks (line 1465)
  4. ISet`1.xml:

    • IsProperSubsetOf remarks (line 288)
    • IsProperSupersetOf remarks (line 349)

All changes remove the word "proper" from the empty set statements to correctly reflect that an empty set is a subset (not a proper subset or proper superset) of all sets.

Impact

Corrects the mathematical explanations without affecting functionality. The method behavior remains unchanged - the documentation now accurately describes what the methods return.

Fixes #11853

Original prompt

This section details on the original issue you should resolve

<issue_title>Mathematically incorrect statement, probably a typo/copy-paste error</issue_title>
<issue_description>### Type of issue

Typo

Description

The remarks section says

An empty set is a proper superset of any other collection.

It should say

An empty set is a subset of any other collection.

Note, not a proper subset.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablesortedset-1.ispropersupersetof?view=net-8.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Collections.Immutable/ImmutableSortedSet`1.xml

Document Version Independent Id

6db3f697-2a43-407f-bb31-9b103716008c

Platform Id

b2b81307-57ac-f3a2-40a2-2c61472b04c9

Article author

@dotnet-bot</issue_description>

Comments on the Issue (you are @copilot in this section)

@eiriktsarpalis Sounds about right.
Fixes #11853

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ation

Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Mathematically incorrect statement, probably a typo/copy-paste error Fix mathematically incorrect statement about empty sets in IsProperSupersetOf documentation Sep 27, 2025
@Copilot Copilot AI requested a review from eiriktsarpalis September 27, 2025 10:44
Copilot finished work on behalf of eiriktsarpalis September 27, 2025 10:44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can you update the other sets as well (ISet, HashSet, etc.)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all set types (ISet, HashSet, SortedSet) with the same fix in commit 65142cb.

<format type="text/markdown"><![CDATA[
## Remarks
An empty set is a proper subset of any other collection. Therefore, this method returns `true` if the current set is empty, unless the `other` collection is also empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement ("An empty set is a proper subset of any other collection.") is also wrong. Update this and other occurrences (e.g. in ISet, HashSet, etc.).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the IsProperSubsetOf statements in all affected files (ImmutableSortedSet, ISet, HashSet, SortedSet). Changed "proper subset" to "subset" in commit 65142cb.

@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 2, 2025
…er set types

Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 2, 2025
@Copilot Copilot AI changed the title Fix mathematically incorrect statement about empty sets in IsProperSupersetOf documentation Fix mathematically incorrect statements about empty sets in set documentation Oct 2, 2025
Copilot finished work on behalf of PranavSenthilnathan October 2, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mathematically incorrect statement, probably a typo/copy-paste error
3 participants