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
- 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 example of a Chain
constructed from an ordered pair.
Equations
- OmegaCompletePartialOrder.Chain.pair a b hab = { toFun := fun (n : ℕ) => match n with | 0 => a | x => b, monotone' := ⋯ }
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_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- ω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
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 function f
between ω
-complete partial orders is ωScottContinuous
if it is
Scott continuous over chains.
Equations
- OmegaCompletePartialOrder.ωScottContinuous f = ScottContinuousOn (Set.range fun (c : OmegaCompletePartialOrder.Chain α) => Set.range ⇑c) f
Instances For
ωScottContinuous f
asserts that f
is both monotone and distributes over ωSup.
Alias of the reverse direction of OmegaCompletePartialOrder.ωScottContinuous_iff_monotone_map_ωSup
.
ωScottContinuous f
asserts that f
is both monotone and distributes over ωSup.
Alias of the forward direction of OmegaCompletePartialOrder.ωScottContinuous_iff_monotone_map_ωSup
.
ωScottContinuous f
asserts that f
is both monotone and distributes over ωSup.
Alias of the forward direction of OmegaCompletePartialOrder.ωScottContinuous_iff_map_ωSup_of_orderHom
.
Alias of the reverse direction of OmegaCompletePartialOrder.ωScottContinuous_iff_map_ωSup_of_orderHom
.
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 : α → β
- map_ωSup' : ∀ (c : OmegaCompletePartialOrder.Chain α), self.toFun (OmegaCompletePartialOrder.ωSup c) = OmegaCompletePartialOrder.ωSup (c.map self.toOrderHom)
The underlying function of a
ContinuousHom
is continuous, i.e. it preservesωSup
Instances For
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.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, map_ωSup' := ⋯ }
Instances For
The identity as a continuous function.
Equations
- OmegaCompletePartialOrder.ContinuousHom.id = { toOrderHom := OrderHom.id, map_ωSup' := ⋯ }
Instances For
The composition of continuous functions.
Equations
- f.comp g = { toOrderHom := f.comp g.toOrderHom, map_ωSup' := ⋯ }
Instances For
Function.const
is a continuous function.
Equations
- OmegaCompletePartialOrder.ContinuousHom.const x = { toOrderHom := (OrderHom.const α) x, map_ωSup' := ⋯ }
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), map_ωSup' := ⋯ }
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' := ⋯, map_ωSup' := ⋯ }
Instances For
Part.bind
as a continuous function.
Equations
- f.bind g = { toOrderHom := (↑f).partBind g.toOrderHom, map_ωSup' := ⋯ }
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
Iteration of a function on an initial element interpreted as a chain.
Equations
- OmegaCompletePartialOrder.fixedPoints.iterateChain f x h = { toFun := fun (n : ℕ) => (⇑f)^[n] x, monotone' := ⋯ }
Instances For
The supremum of iterating a function on x arbitrary often is a fixed point
The supremum of iterating a function on x arbitrary often is smaller than any prefixed point.
A prefixed point is a value a
with f a ≤ a
.
The supremum of iterating a function on x arbitrary often is smaller than any fixed point.