Skip to content

Add interior, closure, boundary functions for Intervals #12

@electronjoe

Description

@electronjoe

Proposal

For mathematical completeness, consider adding:

fn interior(&self) -> Interval<T>  // Topological interior
fn closure(&self) -> Interval<T>   // Topological closure
fn boundary(&self) -> Interval<T>  // Topological boundary

1. Interior (Topological Interior)
The interior of a set consists of all points that have a neighborhood entirely contained within the set.

2. Closure (Topological Closure)
The closure includes all points that can be approximated by points in the set.

3. Boundary (Topological Boundary)
The boundary consists of points where every neighborhood contains both points in and out of the set.

Properties

Some important mathematical properties these functions would satisfy:

  1. x ∈ interior(A) ⟹ x ∈ A
  2. closure(A) contains all limit points of A
  3. boundary(A) = closure(A) \ interior(A)
  4. A is closed ⟺ A = closure(A)
  5. A is open ⟺ A = interior(A)

Challenges

The main implementation challenge is that boundary() naturally wants to return a set of discrete points rather than an interval. This suggests either:

  1. Creating a new type for finite point sets
  2. Returning an iterator of singleton intervals
  3. Modifying the interval type to handle discrete point sets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions