proofs/ordered_ranges.bend checks
raw source on the hub · import stelliferous@0.0.3.0/proofs/ordered_ranges.bend as Ordered_ranges
A finite half-open interval, represented as its consecutive positions.
3 imports
import Base import ./natural_addition.bend as Addition import ../ordered_matrix.bend as OrderedMatrix
Definitions
def range source · line 6 · raw
@n:Nat -> @+start:Nat -> List<&2, Nat>
def split source · line 13 · raw
@+a:Nat -> @+b:Nat -> @+start:Nat -> {range(Nat.add(a, b), start) == 0xd6aaab858a4fbd1461bd0fee27b97184/ordered_matrix.cat(Nat, range(a, start), range(b, Nat.add(start, a))) : List<&2, Nat>}
def join source · line 26 · raw
@+start:Nat -> @+left:Nat -> @+right:Nat -> @+end:Nat -> @+whole:Nat -> @end_exact:{end == Nat.add(start, left) : Nat} -> @size_exact:{Nat.add(left, right) == whole : Nat} -> {0xd6aaab858a4fbd1461bd0fee27b97184/ordered_matrix.cat(Nat, range(left, start), range(right, end)) == range(whole, start) : List<&2, Nat>}[start, end) followed by [end, start + whole) is the whole interval.