LEQuery: Comparison Queries for Sorting #
LEQuery α is the query type for comparison-based sorting algorithms.
A query LEQuery.le a b asks whether a ≤ b and returns a Bool.
@[reducible, inline]
Lift LEQuery.le a b into a FreeM that returns the comparison result.
Equations
Instances For
@[simp]
Build an oracle for LEQuery α from a binary predicate α → α → Bool.
Equations
- Cslib.Query.LEQuery.oracleOf f (Cslib.Query.LEQuery.le a b) = f a b
Instances For
theorem Cslib.Query.LEQuery.cardResponse_eq_two {α ι : Type} :
∀ (a : LEQuery α ι), Cardinal.mk ι = 2
Every LEQuery α ι has response type ι = Bool, of cardinality two.