Semiquotients #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
A data type for semiquotients, which are classically equivalent to
nonempty sets, but are useful for programming; the idea is that
a semiquotient set S
represents some (particular but unknown)
element of S
. This can be used to model nondeterministic functions,
which return something in a range of values (represented by the
predicate S
) but are not completely determined.
A member of semiquot α
is classically a nonempty set α
,
and in the VM is represented by an element of α
; the relation
between these is that the VM element is required to be a member
of the set s
. The specific element of s
that the VM computes
is hidden by a quotient construction, allowing for the representation
of nondeterministic functions.
Instances for semiquot
pure a
is a
reinterpreted as an unspecified element of {a}
.
Equations
Replace s
in a q : semiquot α
with a union s ∪ q.s
Equations
- semiquot.blur s q = q.blur' _
Equations
Equations
- semiquot.semilattice_sup = {sup := λ (s : semiquot α), semiquot.blur s.s, le := partial_order.le semiquot.partial_order, lt := partial_order.lt semiquot.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _}
univ : semiquot α
represents an unspecified element of univ : set α
.
Equations
- semiquot.univ = semiquot.mk semiquot.univ._proof_1
Equations
- semiquot.inhabited = {default := semiquot.univ _inst_1}
Equations
- semiquot.order_top = {top := semiquot.univ _inst_1, le_top := _}