Equations
- Std.Time.Internal.Bounded.instLE = { le := fun (l r : Std.Time.Internal.Bounded rel n m) => l.val ≤ r.val }
Equations
- Std.Time.Internal.Bounded.instLT = { lt := fun (l r : Std.Time.Internal.Bounded rel n m) => l.val < r.val }
Equations
- Std.Time.Internal.Bounded.instRepr = { reprPrec := fun (n_1 : Std.Time.Internal.Bounded rel m n) => reprPrec n_1.val }
Equations
- Std.Time.Internal.Bounded.instBEq = { beq := fun (x y : Std.Time.Internal.Bounded rel n m) => decide (x.val = y.val) }
Equations
- Std.Time.Internal.Bounded.instDecidableLe = inferInstanceAs (Decidable (x.val ≤ y.val))
A Bounded
integer that the relation used is the the less-equal relation so, it includes all
integers that lo ≤ val ≤ hi
.
Instances For
Casts the boundaries of the Bounded
using equivalences.
Equations
- Std.Time.Internal.Bounded.cast h₁ h₂ b = ⟨b.val, ⋯⟩
Instances For
A Bounded
integer that the relation used is the the less-than relation so, it includes all
integers that lo < val < hi
.
Instances For
Convert a Int
to a Bounded
if it checks.
Equations
- Std.Time.Internal.Bounded.ofInt? val = if h : rel lo val ∧ rel val hi then some ⟨val, h⟩ else none
Instances For
Equations
- Std.Time.Internal.Bounded.LE.instOfNatHAddIntCast = { ofNat := let h := ⋯; Std.Time.Internal.Bounded.LE.ofNatWrapping (↑n) h }
Equations
- Std.Time.Internal.Bounded.LE.instInhabitedHAddIntCast = { default := let h := ⋯; Std.Time.Internal.Bounded.LE.ofNatWrapping lo h }
Creates a new Bounded
integer that the relation is less-equal.
Equations
- Std.Time.Internal.Bounded.LE.exact val = ⟨↑val, ⋯⟩
Instances For
Convert a Nat
to a Bounded.LE
if it checks.
Equations
- Std.Time.Internal.Bounded.LE.ofNat? val = if h : val ≤ hi then some (Std.Time.Internal.Bounded.LE.ofNat val h) else none
Instances For
Convert a Nat
to a Bounded.LE
using the lower boundary too.
Equations
Instances For
Convert a Nat
to a Bounded.LE
using the lower boundary too.
Equations
- Std.Time.Internal.Bounded.LE.clip val h = if h₀ : lo ≤ val then if h₁ : val ≤ hi then ⟨val, ⋯⟩ else ⟨hi, ⋯⟩ else ⟨lo, ⋯⟩
Instances For
Convert a Bounded.LE
to a Nat.
Equations
- n.toNat' h = match n.val, ⋯ with | Int.ofNat n, x => n | Int.negSucc a, h => ⋯.elim
Instances For
Convert a Bounded.LE
to a Fin
.
Equations
- n.toFin h₀ = ⟨n.val.toNat, ⋯⟩
Instances For
Convert a Fin
to a Bounded.LE
.
Equations
- Std.Time.Internal.Bounded.LE.ofFin' fin h = if h₁ : ↑fin ≥ lo then Std.Time.Internal.Bounded.LE.ofNat' ↑fin ⋯ else Std.Time.Internal.Bounded.LE.ofNat' lo ⋯
Instances For
Creates a new Bounded.LE
using a the modulus of a number.
Equations
- Std.Time.Internal.Bounded.LE.byEmod b i hi = ⟨b % i, ⋯⟩
Instances For
Creates a new Bounded.LE
using a the Truncating modulus of a number.
Equations
- Std.Time.Internal.Bounded.LE.byMod b i hi = ⟨b.tmod i, ⋯⟩
Instances For
Adjust the bounds of a Bounded
by applying the emod operation constraining the lower bound to 0 and
the upper bound to the value.
Equations
- bounded.emod num hi = Std.Time.Internal.Bounded.LE.byEmod bounded.val num hi
Instances For
Adjust the bounds of a Bounded
by applying the mod operation.
Equations
- bounded.mod num hi = Std.Time.Internal.Bounded.LE.byMod bounded.val num hi
Instances For
Returns the absolute value of the bounded number bo
with bounds -(i - 1)
to i - 1
. The result
will be a new bounded number with bounds 0
to i - 1
.