Typeclasses for Denotational Monad Support #
This file defines typeclasses HasEvalSet m and HasEvalFinset m for asigning a
set of possible outputs to computations in a monad m.
The monad m can be evaluated to get a set of possible outputs.
Note that we don't implement this for Set with the monad type-class strangeness.
Should not be implemented manually if a HasEvalSPMF instance already exists.
Instances
The support of a SetM computation is the resulting set.
Equations
The monad m can be evaluated to get a finite set of possible outputs.
We restrict to the case of decidable equality of the output type, so Finset.biUnion exists.
Note: we can't use MonadHomClass since Finset has no Monad instance.
Instances
theorem
mem_finSupport_iff_mem_support
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
(mx : m α)
(x : α)
:
theorem
finSupport_eq_iff_support_eq_coe
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
(mx : m α)
(s : Finset α)
:
theorem
finSupport_eq_of_support_eq_coe
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
{mx : m α}
{s : Finset α}
(h : support mx = ↑s)
:
theorem
mem_finSupport_of_mem_support
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
{mx : m α}
{x : α}
(h : x ∈ support mx)
:
theorem
mem_support_of_mem_finSupport
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
{mx : m α}
{x : α}
(h : x ∈ finSupport mx)
:
theorem
not_mem_finSupport_of_not_mem_support
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
{mx : m α}
{x : α}
(h : x ∉ support mx)
:
x ∉ finSupport mx
theorem
not_mem_support_of_not_mem_finSupport
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
{mx : m α}
{x : α}
(h : x ∉ finSupport mx)
:
x ∉ support mx
@[simp]
theorem
finSupport_ite
{m : Type u → Type v}
[Monad m]
{α : Type u}
(p : Prop)
[Decidable p]
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
(mx mx' : m α)
:
theorem
finSupport_eqRec
{α β : Type u}
{m : Type u → Type u_1}
[hm : Monad m]
[hms : HasEvalSet m]
[hmfs : HasEvalFinset m]
[hα : DecidableEq α]
(h : α = β)
(mx : m α)
:
Membership in the support of computations in
Instances
instance
decidablePred_mem_support
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalSet.Decidable m]
(mx : m α)
:
DecidablePred fun (x : α) => x ∈ support mx
Equations
instance
decidablePred_mem_finSupport
{m : Type u → Type v}
[Monad m]
{α : Type u}
[HasEvalSet m]
[HasEvalSet.Decidable m]
[HasEvalFinset m]
[DecidableEq α]
(mx : m α)
:
DecidablePred fun (x : α) => x ∈ finSupport mx