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
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.
theorem
Endpoint.below_of_below_of_lt
{α : Type}
[LinearOrder α]
{hi hi' : Endpoint α}
(h : hi.val < hi'.val)
{x : α}
:
theorem
Endpoint.above_of_above_of_lt
{α : Type}
[LinearOrder α]
{lo lo' : Endpoint α}
(h : lo'.val < lo.val)
{x : α}
:
Endpoint operations for intersection and difference #
@[simp]
@[simp]
theorem
Interval.lo_below_hi
{α : Type}
[LinearOrder α]
(I : Interval α)
:
Endpoint.below I.lo.val I.hi
@[simp]
theorem
Interval.hi_above_lo
{α : Type}
[LinearOrder α]
(I : Interval α)
:
Endpoint.above I.hi.val I.lo
theorem
Interval.ext_toSet
{α : Type}
[LinearOrder α]
[DenselyOrdered α]
{I J : Interval α}
(h : I.toSet = J.toSet)
:
@[simp]
theorem
Interval.not_mem_of_disjoint_right
{α : Type}
[LinearOrder α]
{I J : Interval α}
(h : I.disjoint J)
(x : α)
:
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.
@[implicit_reducible]
instance
Interval.instDecidableBeforeOfDecidableEqOfDecidableLE
{α : Type}
[LinearOrder α]
[DecidableEq α]
[DecidableLE α]
{I J : Interval α}
:
Equations
- One or more equations did not get rendered due to their size.
@[simp]
theorem
Interval.before_of_before_of_le
{α : Type}
[LinearOrder α]
{I J K : Interval α}
(hIJ : I.before J)
(hJK : J ≤ K)
:
I.before K
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
Interval difference #
theorem
Interval.Endpoint.above_iff_not_below_complement
{α : Type}
[LinearOrder α]
(x : α)
(e : Endpoint α)
:
above x e is the negation of below x at the complemented endpoint.
theorem
Interval.Endpoint.below_iff_not_above_complement
{α : Type}
[LinearOrder α]
(x : α)
(e : Endpoint α)
:
below x e is the negation of above x at the complemented endpoint.
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.