Module docstring
{"# Monotonicity of monadic operations on Part
"}
{"# Monotonicity of monadic operations on Part
"}
Monotone.partBind
theorem
(hf : Monotone f) (hg : Monotone g) : Monotone fun x ↦ (f x).bind (g x)
lemma Monotone.partBind (hf : Monotone f) (hg : Monotone g) :
Monotone fun x ↦ (f x).bind (g x) := by
rintro x y h a
simp only [and_imp, exists_prop, Part.bind_eq_bind, Part.mem_bind_iff, exists_imp]
exact fun b hb ha ↦ ⟨b, hf h _ hb, hg h _ _ ha⟩
Antitone.partBind
theorem
(hf : Antitone f) (hg : Antitone g) : Antitone fun x ↦ (f x).bind (g x)
lemma Antitone.partBind (hf : Antitone f) (hg : Antitone g) :
Antitone fun x ↦ (f x).bind (g x) := by
rintro x y h a
simp only [and_imp, exists_prop, Part.bind_eq_bind, Part.mem_bind_iff, exists_imp]
exact fun b hb ha ↦ ⟨b, hf h _ hb, hg h _ _ ha⟩
Monotone.partMap
theorem
(hg : Monotone g) : Monotone fun x ↦ (g x).map f
lemma Monotone.partMap (hg : Monotone g) : Monotone fun x ↦ (g x).map f := by
simpa only [← bind_some_eq_map] using hg.partBind monotone_const
Antitone.partMap
theorem
(hg : Antitone g) : Antitone fun x ↦ (g x).map f
lemma Antitone.partMap (hg : Antitone g) : Antitone fun x ↦ (g x).map f := by
simpa only [← bind_some_eq_map] using hg.partBind antitone_const
Monotone.partSeq
theorem
(hf : Monotone f) (hg : Monotone g) : Monotone fun x ↦ f x <*> g x
lemma Monotone.partSeq (hf : Monotone f) (hg : Monotone g) : Monotone fun x ↦ f x <*> g x := by
simpa only [seq_eq_bind_map] using hf.partBind <| Monotone.of_apply₂ fun _ ↦ hg.partMap
Antitone.partSeq
theorem
(hf : Antitone f) (hg : Antitone g) : Antitone fun x ↦ f x <*> g x
lemma Antitone.partSeq (hf : Antitone f) (hg : Antitone g) : Antitone fun x ↦ f x <*> g x := by
simpa only [seq_eq_bind_map] using hf.partBind <| Antitone.of_apply₂ fun _ ↦ hg.partMap
OrderHom.partBind
definition
(f : α →o Part β) (g : α →o β → Part γ) : α →o Part γ
/-- `Part.bind` as a monotone function -/
@[simps]
def partBind (f : α →o Part β) (g : α →o β → Part γ) : α →o Part γ where
toFun x := (f x).bind (g x)
monotone' := f.2.partBind g.2