Internal.Ensures and Internal.MayReturn #
Internal.Ensures p x characterizes the postconditions of a monadic action x: it
holds iff every value returned by x satisfies p. The witness is a Subtype-refined
action y : m {a // p a} that is bind-faithful w.r.t. x.
Internal.MayReturn x a is the strongest postcondition of x evaluated at a:
a is in every postcondition of x ↔ a is reachable as a value of x.
structure Std.Do.Internal.ErasesTo {α : Type u} {m : Type u → Type v} [Bind m] {P : α → Prop} (x : m { b : α // P b }) (y : m α) :
{lean}ErasesTo x y says the property-tagged {name}x is bind-faithful to {name}y: binding
{name}x and forgetting the property agrees with binding {name}y.
The bind-faithful equation: binding
xand projecting agrees with bindingy.
Instances For
structure Std.Do.Internal.IsAttach {m : Type u → Type v} [Bind m] (attach : ⦃α : Type u⦄ → (x : m α) → m { a : α // MayReturn x a }) :
IsAttach attach says attach tags each value of x with its MayReturn proof
in a bind-faithful way.
For each
x, the attached version is bind-faithful withx.