Structural support under monadic operations #
Pure, bind, and map preserve operational reachability through ExactMonadAttach.
Finite-support equations add enumeration assumptions without choosing probabilities.
theorem
support_pure
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(x : α)
:
theorem
mem_support_pure_iff
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(x y : α)
:
theorem
mem_support_pure_iff'
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(x y : α)
:
theorem
eq_of_mem_support_pure
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
{x y : α}
(h : y ∈ support (pure x))
:
obtain-friendly forward direction of mem_support_pure_iff: membership in the support
of a pure forces equality with the pure value.
@[simp]
theorem
finSupport_pure
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
(x : α)
:
theorem
mem_finSupport_pure_iff
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
(x y : α)
:
theorem
mem_finSupport_pure_iff'
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
(x y : α)
:
theorem
support_bind
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(mx : m α)
(my : α → m β)
:
theorem
mem_support_bind_iff
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(mx : m α)
(my : α → m β)
(y : β)
:
theorem
support_bind_exists
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
{x : m α}
{f : α → m β}
{y : β}
(hy : y ∈ support (x >>= f))
:
obtain-friendly forward direction of mem_support_bind_iff: peel an element of the
support of a bind into a witness for the first computation and membership for the second.
@[simp]
theorem
finSupport_bind
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
[DecidableEq β]
(mx : m α)
(my : α → m β)
:
theorem
mem_finSupport_bind_iff
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
[DecidableEq β]
(mx : m α)
(my : α → m β)
(y : β)
:
theorem
support_map
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(f : α → β)
(mx : m α)
:
@[simp]
theorem
finSupport_map
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
[HasEvalFinset m]
[DecidableEq α]
[DecidableEq β]
(f : α → β)
(mx : m α)
:
@[simp]
theorem
allOutputsSatisfy_pure
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(p : α → Prop)
(x : α)
:
@[simp]
theorem
someOutputSatisfies_pure
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(p : α → Prop)
(x : α)
:
@[simp]
theorem
allOutputsSatisfy_bind
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(mx : m α)
(my : α → m β)
(p : β → Prop)
:
@[simp]
theorem
someOutputSatisfies_bind
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
[MonadAttach m]
[ExactMonadAttach m]
(mx : m α)
(my : α → m β)
(p : β → Prop)
:
someOutputSatisfies p (mx >>= my) ↔ someOutputSatisfies (fun (a : α) => someOutputSatisfies p (my a)) mx