Intervals over linear orders #
This file defines closed/open intervals over a linear order and the operations needed to build the interval-union semiring.
Main definitions #
Endpoint α– an endpoint of an interval: a value inαtogether with aclosedflag indicating whether the endpoint is includedInterval α– an interval with possibly open endpoints whose endpoints satisfylo.val < hi.val, orlo.val = hi.valwith both endpoints closedInterval.toSet– the set of points belonging to an intervalInterval.disjoint– two intervals are disjoint when their point sets are disjointInterval.before–I.before JmeansIlies strictly to the left ofJ(no point is shared and they cannot be merged)Interval.inter– intersection of two intervalsInterval.diff– difference of two intervals (a list of at most two intervals)
Main results #
Interval.toSet_not_empty– every well-formed interval contains at least one pointInterval.ext_toSet– two intervals with the same point set are equal (requiresDenselyOrdered)Interval.mem_inter– membership in the intersection is conjunction of membershipsInterval.mem_diff– membership in the difference is membership minus exclusionInterval.disjoint_of_before–beforeimpliesdisjoint
An endpoint of an interval: a value together with a boolean flag indicating
whether the endpoint is included (closed = true) or excluded (closed = false).
- val : α
- closed : Bool
Instances For
Dependency graph
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
above x lo holds when x is on the correct side of the lower endpoint lo,
respecting its closedness: lo.val ≤ x if closed, lo.val < x if open.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Endpoint operations for intersection and difference #
Most restrictive (largest) lower endpoint: above x (maxLo a b) ↔ above x a ∧ above x b.
Equations
Instances For
Dependency graph
Most restrictive (smallest) upper endpoint: below x (minHi a b) ↔ below x a ∧ below x b.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
An interval over a linear order, given by a lower endpoint lo and an upper
endpoint hi satisfying lo.val < hi.val (strict) or lo.val = hi.val with both
endpoints closed (degenerate point interval).
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The set of points belonging to an interval: those x that are above lo
and below hi according to their respective closedness flags.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Two intervals are disjoint when their point sets have empty intersection.
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
I.before J means the intervals are strictly separated and cannot be merged:
either I.hi.val < J.lo.val, or the endpoints meet at the same value but both are open.
Equations
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Dependency graph
Dependency graph
Interval intersection #
Intersection of two intervals: empty or a single interval.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Interval difference #
above x e is the negation of below x at the complemented endpoint.
Dependency graph
below x e is the negation of above x at the complemented endpoint.
Dependency graph
Difference I \ J: the left piece (below J) and right piece (above J) of I.
Equations
- One or more equations did not get rendered due to their size.