This module provides instances that reduce the amount of code necessary to make a type compatible
with the polymorphic ranges. For an example of the required work, take a look at
Init.Data.Range.Polymorphic.Nat
.
instance
Std.PRange.instLawfulUpwardEnumerableUpperBoundClosedOfLawfulUpwardEnumerableLEOfTransLe
{α : Type u_1}
[LE α]
[DecidableLE α]
[UpwardEnumerable α]
[LawfulUpwardEnumerableLE α]
[Trans (fun (x1 x2 : α) => x1 ≤ x2) (fun (x1 x2 : α) => x1 ≤ x2) fun (x1 x2 : α) => x1 ≤ x2]
:
instance
Std.PRange.instLinearlyUpwardEnumerableOfTotalLeOfLawfulUpwardEnumerableOfLawfulUpwardEnumerableLE
{α : Type u_1}
[LE α]
[Total fun (x1 x2 : α) => x1 ≤ x2]
[UpwardEnumerable α]
[LawfulUpwardEnumerable α]
[LawfulUpwardEnumerableLE α]
:
@[reducible, inline]
Creates a RangeSize .open α
from a RangeSize .closed α
instance. If the latter is lawful
and certain other conditions hold, then the former is also lawful by
LawfulRangeSize.open_of_closed
.
Equations
- Std.PRange.RangeSize.openOfClosed = { size := fun (bound : Std.PRange.Bound Std.PRange.BoundShape.open α) (a : α) => Std.PRange.RangeSize.size bound a - 1 }
Instances For
instance
Std.PRange.LawfulRangeSize.open_of_closed
{α : Type u_1}
[UpwardEnumerable α]
[LE α]
[DecidableLE α]
[LT α]
[DecidableLT α]
[LawfulOrderLT α]
[IsPartialOrder α]
[LawfulUpwardEnumerable α]
[LawfulUpwardEnumerableLE α]
[RangeSize BoundShape.closed α]
[LawfulRangeSize BoundShape.closed α]
:
instance
Std.PRange.LawfulRangeSize.instHasFiniteRanges
{α : Type u_1}
{su : BoundShape}
[UpwardEnumerable α]
[LawfulUpwardEnumerable α]
[RangeSize su α]
[SupportsUpperBound su α]
[LawfulRangeSize su α]
:
HasFiniteRanges su α