Evaluation Distributions of Computations with seq #
File for lemmas about evalDist and support involving the monadic seq, seqLeft,
and seqRight operations.
TODO: many lemmas should probably have mirrored versions for bind_map.
@[simp]
theorem
support_seq
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSet m]
[LawfulMonad m]
(mf : m (α → β))
(mx : m α)
:
theorem
mem_support_seq_iff
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSet m]
[LawfulMonad m]
(mf : m (α → β))
(mx : m α)
(y : β)
:
@[simp]
theorem
finSupport_seq
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSet m]
[HasEvalFinset m]
[LawfulMonad m]
[DecidableEq (α → β)]
[DecidableEq α]
[DecidableEq β]
(mf : m (α → β))
(mx : m α)
:
@[simp]
theorem
evalDist_seq
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSPMF m]
[LawfulMonad m]
(mf : m (α → β))
(mx : m α)
:
@[simp]
theorem
evalDist_seqLeft
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSPMF m]
[LawfulMonad m]
(mx : m α)
(my : m β)
:
@[simp]
theorem
evalDist_seqRight
{α β : Type u}
{m : Type u → Type v}
[Monad m]
[HasEvalSPMF m]
[LawfulMonad m]
(mx : m α)
(my : m β)
:
@[simp]
theorem
support_seq_map_eq_image2
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
:
@[simp]
theorem
finSupport_seq_map_eq_image2
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
:
theorem
evalDist_seq_map
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
:
theorem
mem_support_seq_map_iff_of_injective2
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
(hf : Function.Injective2 f)
(x : α)
(y : β)
:
theorem
mem_finSupport_seq_map_iff_of_injective2
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
(hf : Function.Injective2 f)
(x : α)
(y : β)
:
theorem
probOutput_seq_map_swap
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
(z : γ)
:
theorem
evalDist_seq_map_swap
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
:
theorem
probEvent_seq_map_swap
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
(p : γ → Prop)
:
theorem
support_seq_map_swap
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
:
theorem
finSupport_seq_map_swap
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSet m]
[HasEvalFinset m]
[DecidableEq γ]
:
theorem
probEvent_seq_map_eq_mul
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
(p : γ → Prop)
(q1 : α → Prop)
(q2 : β → Prop)
(h : ∀ x ∈ support mx, ∀ y ∈ support my, p (f x y) ↔ q1 x ∧ q2 y)
:
theorem
probOutput_seq_map_eq_mul
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
(x : α)
(y : β)
(z : γ)
(h : ∀ x' ∈ support mx, ∀ y' ∈ support my, z = f x' y' ↔ x' = x ∧ y' = y)
:
theorem
probEvent_seq_map_eq_probEvent_comp_uncurry
{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(mx : m α)
(my : m β)
(f : α → β → γ)
[HasEvalSPMF m]
(p : γ → Prop)
: