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
OmegaCompletePartialOrder
ite
,map
,bind
,seq
as continuous morphisms
Instances of OmegaCompletePartialOrder
#
Part
- every
CompleteLattice
- pi-types
- product types
OrderHom
ContinuousHom
(with notation →𝒄)- an instance of
OmegaCompletePartialOrder (α →𝒄 β)
- an instance of
ContinuousHom.ofFun
ContinuousHom.ofMono
- continuous functions:
References #
- [Chain-complete posets and directed sets with applications][markowsky1976]
- [Recursive definitions of partial functions and their computations][cadiou1972]
- [Semantics of Programming Languages: Structures and Techniques][gunter1992]
A chain is a monotone sequence.
See the definition on page 114 of [gunter1992].
Equations
- OmegaCompletePartialOrder.Chain α = (ℕ →o α)
Instances For
Equations
- ⋯ = ⋯
Equations
- OmegaCompletePartialOrder.Chain.instCoeFunForallNat = { coe := DFunLike.coe }
Equations
- OmegaCompletePartialOrder.Chain.instInhabited = { default := { toFun := default, monotone' := ⋯ } }
Equations
- OmegaCompletePartialOrder.Chain.instLE = { le := fun (x y : OmegaCompletePartialOrder.Chain α) => ∀ (i : ℕ), ∃ (j : ℕ), x i ≤ y j }
Equations
- c.map f = f.comp c
Instances For
OmegaCompletePartialOrder.Chain.zip
pairs up the elements of two chains
that have the same index.
Equations
- c₀.zip c₁ = OrderHom.prod c₀ c₁
Instances For
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 [gunter1992].
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- ωSup : OmegaCompletePartialOrder.Chain α → α
The supremum of an increasing sequence
- le_ωSup : ∀ (c : OmegaCompletePartialOrder.Chain α) (i : ℕ), c i ≤ OmegaCompletePartialOrder.ωSup c
ωSup
is an upper bound of the increasing sequence - ωSup_le : ∀ (c : OmegaCompletePartialOrder.Chain α) (x : α), (∀ (i : ℕ), c i ≤ x) → OmegaCompletePartialOrder.ωSup c ≤ x
ωSup
is a lower bound of the set of upper bounds of the increasing sequence
Instances
ωSup
is an upper bound of the increasing sequence
ωSup
is a lower bound of the set of upper bounds of the increasing sequence
Transfer an OmegaCompletePartialOrder
on β
to an OmegaCompletePartialOrder
on α
using a strictly monotone function f : β →o α
, a definition of ωSup and a proof that f
is
continuous with regard to the provided ωSup
and the ωCPO on α
.
Equations
- OmegaCompletePartialOrder.lift f ωSup₀ h h' = OmegaCompletePartialOrder.mk ωSup₀ ⋯ ⋯
Instances For
A subset p : α → Prop
of the type closed under ωSup
induces an
OmegaCompletePartialOrder
on the subtype {a : α // p a}
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A monotone function f : α →o β
is continuous if it distributes over ωSup.
In order to distinguish it from the (more commonly used) continuity from topology
(see Mathlib/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
- OmegaCompletePartialOrder.Continuous f = ∀ (c : OmegaCompletePartialOrder.Chain α), f (OmegaCompletePartialOrder.ωSup c) = OmegaCompletePartialOrder.ωSup (c.map f)
Instances For
Continuous' f
asserts that f
is both monotone and continuous.
Equations
- OmegaCompletePartialOrder.Continuous' f = ∃ (hf : Monotone f), OmegaCompletePartialOrder.Continuous { toFun := f, monotone' := hf }
Instances For
Equations
- Part.omegaCompletePartialOrder = OmegaCompletePartialOrder.mk Part.ωSup ⋯ ⋯
Equations
- One or more equations did not get rendered due to their size.
The supremum of a chain in the product ω
-CPO.
Equations
- Prod.ωSup c = (OmegaCompletePartialOrder.ωSup (c.map OrderHom.fst), OmegaCompletePartialOrder.ωSup (c.map OrderHom.snd))
Instances For
Equations
- Prod.instOmegaCompletePartialOrder = OmegaCompletePartialOrder.mk Prod.ωSup ⋯ ⋯
Any complete lattice has an ω
-CPO structure where the countable supremum is a special case
of arbitrary suprema.
Equations
- CompleteLattice.instOmegaCompletePartialOrder α = OmegaCompletePartialOrder.mk (fun (c : OmegaCompletePartialOrder.Chain α) => ⨆ (i : ℕ), c i) ⋯ ⋯
The ωSup
operator for monotone functions.
Equations
- OmegaCompletePartialOrder.OrderHom.ωSup c = { toFun := fun (a : α) => OmegaCompletePartialOrder.ωSup (c.map (OrderHom.apply a)), monotone' := ⋯ }
Instances For
Equations
- OmegaCompletePartialOrder.OrderHom.omegaCompletePartialOrder = OmegaCompletePartialOrder.lift OrderHom.coeFnHom OmegaCompletePartialOrder.OrderHom.ωSup ⋯ ⋯
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 OrderHom.continuous
.
- toFun : α → β
- monotone' : Monotone self.toFun
- cont : OmegaCompletePartialOrder.Continuous self.toOrderHom
The underlying function of a
ContinuousHom
is continuous, i.e. it preservesωSup
Instances For
The underlying function of a ContinuousHom
is continuous, i.e. it preserves ωSup
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 OrderHom.continuous
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- OmegaCompletePartialOrder.instFunLikeContinuousHom α β = { coe := fun (f : α →𝒄 β) => f.toFun, coe_injective' := ⋯ }
Equations
- ⋯ = ⋯
Equations
- OmegaCompletePartialOrder.instPartialOrderContinuousHom α β = PartialOrder.lift (fun (f : α →𝒄 β) => f.toFun) ⋯
See Note [custom simps projection]. We specify this explicitly because we don't have a DFunLike instance.
Equations
Instances For
Construct a continuous function from a bare function, a continuous function, and a proof that they are equal.
Equations
- OmegaCompletePartialOrder.ContinuousHom.copy f g h = { toOrderHom := g.copy f h, cont := ⋯ }
Instances For
The identity as a continuous function.
Equations
- OmegaCompletePartialOrder.ContinuousHom.id = { toOrderHom := OrderHom.id, cont := ⋯ }
Instances For
The composition of continuous functions.
Equations
- f.comp g = { toOrderHom := f.comp g.toOrderHom, cont := ⋯ }
Instances For
Function.const
is a continuous function.
Equations
- OmegaCompletePartialOrder.ContinuousHom.const x = { toOrderHom := (OrderHom.const α) x, cont := ⋯ }
Instances For
Equations
- OmegaCompletePartialOrder.ContinuousHom.instInhabited = { default := OmegaCompletePartialOrder.ContinuousHom.const default }
The map from continuous functions to monotone functions is itself a monotone function.
Equations
Instances For
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
- OmegaCompletePartialOrder.ContinuousHom.ωSup c = { toOrderHom := OmegaCompletePartialOrder.ωSup (c.map OmegaCompletePartialOrder.ContinuousHom.toMono), cont := ⋯ }
Instances For
Equations
- OmegaCompletePartialOrder.ContinuousHom.inst = OmegaCompletePartialOrder.lift OmegaCompletePartialOrder.ContinuousHom.toMono OmegaCompletePartialOrder.ContinuousHom.ωSup ⋯ ⋯
The application of continuous functions as a continuous function.
Equations
Instances For
A family of continuous functions yields a continuous family of functions.
Equations
- OmegaCompletePartialOrder.ContinuousHom.flip f = { toFun := fun (x : β) (y : α) => (f y) x, monotone' := ⋯, cont := ⋯ }
Instances For
Part.map
as a continuous function.
Equations
- OmegaCompletePartialOrder.ContinuousHom.map f g = OmegaCompletePartialOrder.ContinuousHom.copy (fun (x : α) => f <$> g x) (g.bind (OmegaCompletePartialOrder.ContinuousHom.const (pure ∘ f))) ⋯
Instances For
Part.seq
as a continuous function.
Equations
- One or more equations did not get rendered due to their size.