Semiquotients #
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.
- mk' :: (
- )
Instances For
Equations
- Semiquot.instMembership = { mem := fun (q : Semiquot α) (a : α) => a ∈ q.s }
theorem
Semiquot.eq_mk_of_mem
{α : Type u_1}
{q : Semiquot α}
{a : α}
(h : a ∈ q)
:
q = Semiquot.mk h
theorem
Semiquot.blur_eq_blur'
{α : Type u_1}
(q : Semiquot α)
(s : Set α)
(h : q.s ⊆ s)
:
Semiquot.blur s q = q.blur' h
@[simp]
theorem
Semiquot.mem_map
{α : Type u_1}
{β : Type u_2}
(f : α → β)
(q : Semiquot α)
(b : β)
:
b ∈ Semiquot.map f q ↔ ∃ a ∈ q, f a = b
@[simp]
theorem
Semiquot.map_def
{α β : Type u_1}
:
(fun (x1 : α → β) (x2 : Semiquot α) => x1 <$> x2) = Semiquot.map
@[simp]
theorem
Semiquot.bind_def
{α β : Type u_1}
:
(fun (x1 : Semiquot α) (x2 : α → Semiquot β) => x1 >>= x2) = Semiquot.bind
Equations
- Semiquot.instLE = { le := fun (s t : Semiquot α) => s.s ⊆ t.s }
Equations
Equations
- Semiquot.instSemilatticeSup = SemilatticeSup.mk (fun (s : Semiquot α) => Semiquot.blur s.s) ⋯ ⋯ ⋯
theorem
Semiquot.IsPure.mono
{α : Type u_1}
{s t : Semiquot α}
(st : s ≤ t)
(h : t.IsPure)
:
s.IsPure
Equations
- Semiquot.instInhabited = { default := Semiquot.univ }
@[simp]