Omega Complete Partial Orders
An omega-complete partial order is a partial order with a supremum
operation on increasing sequences indexed by natural numbers (which we
call ωSup
). In this sense, it is strictly weaker than join complete
semi-lattices as only ω-sized totally ordered sets have a supremum.
The concept of an omega-complete partial order (ωCPO) is useful for the formalization of the semantics of programming languages. Its notion of supremum helps define the meaning of recursive procedures.
Main definitions
- class
omega_complete_partial_order
ite
,map
,bind
,seq
as continuous morphisms
Instances of omega_complete_partial_order
roption
- every
complete_lattice
- pi-types
- product types
monotone_hom
continuous_hom
(with notation →𝒄)- an instance of
omega_complete_partial_order (α →𝒄 β)
- an instance of
continuous_hom.of_fun
continuous_hom.of_mono
- continuous functions:
id
ite
const
roption.bind
roption.map
roption.seq
References
- [G. Markowsky, Chain-complete posets and directed sets with applications, https://doi.org/10.1007/BF02485815][markowsky]
- [J. M. Cadiou and Zohar Manna, Recursive definitions of partial functions and their computations., https://doi.org/10.1145/942580.807072][cadiou]
- [Carl A. Gunter, Semantics of Programming Languages: Structures and Techniques, ISBN: 0262570955][gunter]
The constant function, as a monotone function.
Equations
- preorder_hom.const α f = {to_fun := function.const α f, monotone' := _}
The diagonal function, as a monotone function.
Equations
- preorder_hom.prod.diag = {to_fun := λ (x : α), (x, x), monotone' := _}
A chain is a monotonically increasing sequence.
See the definition on page 114 of [gunter].
Equations
Equations
- omega_complete_partial_order.chain.has_le = {le := λ (x y : omega_complete_partial_order.chain α), ∀ (i : ℕ), ∃ (j : ℕ), ⇑x i ≤ ⇑y j}
map
function for chain
chain.zip
pairs up the elements of two chains that have the same index
Equations
- c₀.zip c₁ = preorder_hom.prod.zip c₀ c₁
- to_partial_order : partial_order α
- ωSup : omega_complete_partial_order.chain α → α
- le_ωSup : ∀ (c_1 : omega_complete_partial_order.chain α) (i : ℕ), ⇑c_1 i ≤ omega_complete_partial_order.ωSup c_1
- ωSup_le : ∀ (c_1 : omega_complete_partial_order.chain α) (x : α), (∀ (i : ℕ), ⇑c_1 i ≤ x) → omega_complete_partial_order.ωSup c_1 ≤ x
An omega-complete partial order is a partial order with a supremum
operation on increasing sequences indexed by natural numbers (which we
call ωSup
). In this sense, it is strictly weaker than join complete
semi-lattices as only ω-sized totally ordered sets have a supremum.
See the definition on page 114 of [gunter].
Instances
- complete_lattice.omega_complete_partial_order
- roption.omega_complete_partial_order
- pi.omega_complete_partial_order
- prod.omega_complete_partial_order
- omega_complete_partial_order.preorder_hom.omega_complete_partial_order
- omega_complete_partial_order.continuous_hom.omega_complete_partial_order
- ωCPO.omega_complete_partial_order
Transfer a omega_complete_partial_order
on β
to a omega_complete_partial_order
on α
using
a strictly monotone function f : β →ₘ α
, a definition of ωSup and a proof that f
is continuous
with regard to the provided ωSup
and the ωCPO on α
.
Equations
- omega_complete_partial_order.lift f ωSup₀ h h' = {to_partial_order := _inst_2, ωSup := ωSup₀, le_ωSup := _, ωSup_le := _}
A monotone function f : α →ₘ β
is continuous if it distributes over ωSup.
In order to distinguish it from the (more commonly used) continuity from topology (see topology/basic.lean), the present definition is often referred to as "Scott-continuity" (referring to Dana Scott). It corresponds to continuity in Scott topological spaces (not defined here).
Equations
continuous' f
asserts that f
is both monotone and continuous.
Equations
- omega_complete_partial_order.continuous' f = ∃ (hf : monotone f), omega_complete_partial_order.continuous {to_fun := f, monotone' := hf}
The (noncomputable) ωSup
definition for the ω
-CPO structure on roption α
.
Equations
- roption.ωSup c = dite (∃ (a : α), roption.some a ∈ c) (λ (h : ∃ (a : α), roption.some a ∈ c), roption.some (classical.some h)) (λ (h : ¬∃ (a : α), roption.some a ∈ c), roption.none)
Equations
- roption.omega_complete_partial_order = {to_partial_order := order_bot.to_partial_order (roption α) roption.order_bot, ωSup := roption.ωSup α, le_ωSup := _, ωSup_le := _}
Function application λ f, f a
is monotone with respect to f
for fixed a
.
Equations
- pi.monotone_apply a = {to_fun := λ (f : Π (a : α), β a), f a, monotone' := _}
Equations
- pi.omega_complete_partial_order = {to_partial_order := pi.partial_order (λ (i : α), omega_complete_partial_order.to_partial_order), ωSup := λ (c : omega_complete_partial_order.chain (Π (a : α), β a)) (a : α), omega_complete_partial_order.ωSup (c.map (pi.monotone_apply a)), le_ωSup := _, ωSup_le := _}
The supremum of a chain in the product ω
-CPO.
Equations
- prod.omega_complete_partial_order = {to_partial_order := prod.partial_order α β omega_complete_partial_order.to_partial_order, ωSup := prod.ωSup _inst_2, le_ωSup := _, ωSup_le := _}
Any complete lattice has an ω
-CPO structure where the countable supremum is a special case
of arbitrary suprema.
Equations
- complete_lattice.omega_complete_partial_order α = {to_partial_order := order_bot.to_partial_order α (bounded_lattice.to_order_bot α), ωSup := λ (c : omega_complete_partial_order.chain α), ⨆ (i : ℕ), ⇑c i, le_ωSup := _, ωSup_le := _}
Function application λ f, f a
(for fixed a
) is a monotone function from the
monotone function space α →ₘ β
to β
.
The "forgetful functor" from α →ₘ β
to α → β
that takes the underlying function,
is monotone.
The ωSup
operator for monotone functions.
Equations
Equations
- omega_complete_partial_order.preorder_hom.omega_complete_partial_order = omega_complete_partial_order.lift omega_complete_partial_order.preorder_hom.to_fun_hom omega_complete_partial_order.preorder_hom.ωSup omega_complete_partial_order.preorder_hom.omega_complete_partial_order._proof_1 omega_complete_partial_order.preorder_hom.omega_complete_partial_order._proof_2
- to_fun : α → β
- monotone' : monotone c.to_fun
- cont : omega_complete_partial_order.continuous {to_fun := c.to_fun, monotone' := _}
A monotone function on ω
-continuous partial orders is said to be continuous
if for every chain c : chain α
, f (⊔ i, c i) = ⊔ i, f (c i)
.
This is just the bundled version of preorder_hom.continuous
.
Equations
- omega_complete_partial_order.has_coe_to_fun α β = {F := λ (_x : α →𝒄 β), α → β, coe := omega_complete_partial_order.continuous_hom.to_fun _inst_2}
Equations
Construct a continuous function from a bare function, a continuous function, and a proof that they are equal.
Construct a continuous function from a monotone function with a proof of continuity.
The identity as a continuous function.
Equations
- omega_complete_partial_order.continuous_hom.id = omega_complete_partial_order.continuous_hom.of_mono preorder_hom.id omega_complete_partial_order.continuous_hom.id._proof_1
The composition of continuous functions.
function.const
is a continuous function.
The application of continuous functions as a monotone function.
(It would make sense to make it a continuous function, but we are currently constructing a
omega_complete_partial_order
instance for α →𝒄 β
, and we cannot use it as the domain or image
of a continuous function before we do.)
The map from continuous functions to monotone functions is itself a monotone function.
When proving that a chain of applications is below a bound z
, it suffices to consider the
functions and values being selected from the same index in the chains.
This lemma is more specific than necessary, i.e. c₀
only needs to be a
chain of monotone functions, but it is only used with continuous functions.
The ωSup
operator for continuous functions, which takes the pointwise countable supremum
of the functions in the ω
-chain.
Equations
- omega_complete_partial_order.continuous_hom.omega_complete_partial_order = omega_complete_partial_order.lift omega_complete_partial_order.continuous_hom.to_mono omega_complete_partial_order.continuous_hom.ωSup omega_complete_partial_order.continuous_hom.omega_complete_partial_order._proof_1 omega_complete_partial_order.continuous_hom.omega_complete_partial_order._proof_2
A family of continuous functions yields a continuous family of functions.
roption.bind
as a continuous function.
roption.map
as a continuous function.
Equations
- omega_complete_partial_order.continuous_hom.map f g = omega_complete_partial_order.continuous_hom.of_fun (λ (x : α), f <$> ⇑g x) (g.bind (omega_complete_partial_order.continuous_hom.const (pure ∘ f))) _
roption.seq
as a continuous function.
Equations
- f.seq g = omega_complete_partial_order.continuous_hom.of_fun (λ (x : α), ⇑f x <*> ⇑g x) (f.bind (omega_complete_partial_order.continuous_hom.flip (flip omega_complete_partial_order.continuous_hom.map g))) _