Semantic model of Batcher sorting networks #
This is the record-level semantic layer used to prove that the explicit Boolean circuit sorts complete records by a projected key.
Four-point lattice characterization of a bitonic sequence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A sequence is increasing in its index order.
Equations
- Algebraic.MassProduction.Sorting.Semantics.SequenceIncreasing sequence = ∀ (i j : Fin n), i < j → sequence i ≤ sequence j
Instances For
A sequence is decreasing in its index order.
Equations
- Algebraic.MassProduction.Sorting.Semantics.SequenceDecreasing sequence = ∀ (i j : Fin n), i < j → sequence j ≤ sequence i
Instances For
Every value of the first sequence is at most every value of the second.
Equations
- Algebraic.MassProduction.Sorting.Semantics.SequenceAllLE first second = ∀ (i : Fin n) (j : Fin m), first i ≤ second j
Instances For
Every output value occurs somewhere in the input sequence.
Equations
- Algebraic.MassProduction.Sorting.Semantics.SequenceRangeContained output input = ∀ (i : Fin n), ∃ (j : Fin m), output i = input j
Instances For
The output sequence is a permutation of the input sequence.
Equations
- Algebraic.MassProduction.Sorting.Semantics.SequencePermutes output input = (List.ofFn output).Perm (List.ofFn input)
Instances For
Exactly one position of a finite sequence satisfies a predicate.
Equations
Instances For
The positions of a finite sequence satisfying a predicate. Classical decidability is confined to the value of this definition.
Equations
- Algebraic.MassProduction.Sorting.Semantics.matchingIndices sequence predicate = {index : Fin n | predicate (sequence index)}
Instances For
Boolean reflection of a predicate, with the chosen decision procedure kept out of theorem signatures.
Equations
- Algebraic.MassProduction.Sorting.Semantics.predicateBit predicate value = decide (predicate value)
Instances For
Unique satisfaction is equivalent to the matching-position set having cardinality one.
Counting true predicate bits agrees with counting matching positions.
Range containment is transitive.
Every finite sequence is a permutation of itself.
Sequence permutation is transitive.
Applying the same observation to two permuted finite sequences preserves their permutation relation.
Every output of a finite-sequence permutation is an input value.
A permutation preserves the number of positions satisfying a predicate.
A sequence permutation preserves unique satisfaction of a predicate.
Reindexing a finite sequence along an equality of lengths preserves its unique matching position.
Reindexing a finite sequence along an equality of lengths preserves the number of matching positions.
Concatenation of two finite sequences.
Equations
- Algebraic.MassProduction.Sorting.Semantics.appendSequence first second = Fin.append first second
Instances For
A unique match in the left sequence remains unique after appending a right sequence with no matches.
A unique match in the right sequence remains unique after prepending a left sequence with no matches.
Matching positions in an appended sequence split additively.
In an increasing sequence, the index of a unique value equals the number of sequence entries strictly below it.
Concatenating two pairs of permuted sequences preserves permutation.
Pointwise minimum of equal-length sequences.
Equations
- Algebraic.MassProduction.Sorting.Semantics.pointwiseMin first second i = min (first i) (second i)
Instances For
Pointwise maximum of equal-length sequences.
Equations
- Algebraic.MassProduction.Sorting.Semantics.pointwiseMax first second i = max (first i) (second i)
Instances For
First half of a record-level network sequence.
Equations
- Algebraic.MassProduction.Sorting.Semantics.recordFirstHalf input index = input (Fin.castAdd (Algebraic.MassProduction.Sorting.networkRecords depth) index)
Instances For
Second half of a record-level network sequence.
Equations
- Algebraic.MassProduction.Sorting.Semantics.recordSecondHalf input index = input (Fin.natAdd (Algebraic.MassProduction.Sorting.networkRecords depth) index)
Instances For
Join two record-level half sequences.
Equations
- Algebraic.MassProduction.Sorting.Semantics.joinRecordHalves first second = Fin.append first second
Instances For
The record-specific and general sequence append operations agree.
One record-level butterfly layer over a linear order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Record-level bitonic merge over a linear order.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.MassProduction.Sorting.Semantics.orderedBitonicMerge 0 x✝ input = input
Instances For
Record-level Batcher sorter over a linear order.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.MassProduction.Sorting.Semantics.orderedBitonicSort 0 x✝ input = input
Instances For
Source record selected for one output of a keyed compare layer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One compare layer on records ordered only through a separate key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Keyed record-level bitonic merge.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.MassProduction.Sorting.Semantics.keyedBitonicMerge key 0 x✝ input = input
Instances For
Keyed record-level Batcher sorter.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.MassProduction.Sorting.Semantics.keyedBitonicSort key 0 x✝ input = input