This module contains some basic definitions and results from domain theory, intended to be used as
the underlying construction of the partial_fixpoint
feature. It is not meant to be used as a
general purpose library for domain theory, but can be of interest to users who want to extend
the partial_fixpoint
machinery (e.g. mark more functions as monotone or register more monads).
This follows the corresponding Isabelle development, as also described in Alexander Krauss: Recursive Definitions of Monadic Functions.
A partial order is a reflexive, transitive and antisymmetric relation.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
- rel : α → α → Prop
A “less-or-equal-to” or “approximates” relation.
This is intended to be used in the construction of
partial_fixpoint
, and not meant to be used otherwise. - rel_refl {x : α} : Lean.Order.PartialOrder.rel x x
- rel_trans {x y z : α} : Lean.Order.PartialOrder.rel x y → Lean.Order.PartialOrder.rel y z → Lean.Order.PartialOrder.rel x z
- rel_antisymm {x y : α} : Lean.Order.PartialOrder.rel x y → Lean.Order.PartialOrder.rel y x → x = y
Instances
A “less-or-equal-to” or “approximates” relation.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.«term_⊑_» = Lean.ParserDescr.trailingNode `Lean.Order.«term_⊑_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊑ ") (Lean.ParserDescr.cat `term 51))
Instances For
A chain is a totally ordered set (representing a set as a predicate).
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.chain c = ∀ (x y : α), c x → c y → Lean.Order.PartialOrder.rel x y ∨ Lean.Order.PartialOrder.rel y x
Instances For
A chain-complete partial order (CCPO) is a partial order where every chain a least upper bound.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
- rel_trans {x y z : α} : Lean.Order.PartialOrder.rel x y → Lean.Order.PartialOrder.rel y z → Lean.Order.PartialOrder.rel x z
- csup : (α → Prop) → α
The least upper bound of a chain.
This is intended to be used in the construction of
partial_fixpoint
, and not meant to be used otherwise. - csup_spec {x : α} {c : α → Prop} (hc : Lean.Order.chain c) : Lean.Order.PartialOrder.rel (Lean.Order.CCPO.csup c) x ↔ ∀ (y : α), c y → Lean.Order.PartialOrder.rel y x
Instances
The bottom element is the least upper bound of the empty chain.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.bot = Lean.Order.CCPO.csup fun (x : α) => False
Instances For
Equations
- Lean.Order.«term⊥» = Lean.ParserDescr.node `Lean.Order.«term⊥» 1024 (Lean.ParserDescr.symbol "⊥")
Instances For
A function is monotone if if it maps related elements to releated elements.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.monotone f = ∀ (x y : α), Lean.Order.PartialOrder.rel x y → Lean.Order.PartialOrder.rel (f x) (f y)
Instances For
A predicate is admissable if it can be transferred from the elements of a chain to the chains least upper bound. Such predicates can be used in fixpoint induction.
This definition implies P ⊥
. Sometimes (e.g. in Isabelle) the empty chain is excluded
from this definition, and P ⊥
is a separate condition of the induction predicate.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.admissible P = ∀ (c : α → Prop), Lean.Order.chain c → (∀ (x : α), c x → P x) → P (Lean.Order.CCPO.csup c)
Instances For
Equations
- ⋯ = ⋯
Instances For
The transfinite iteration of a function f
is a set that is ⊥
and is closed under application
of f
and csup
.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
- step {α : Sort u} [Lean.Order.CCPO α] {f : α → α} {x : α} : Lean.Order.iterates f x → Lean.Order.iterates f (f x)
- sup {α : Sort u} [Lean.Order.CCPO α] {f : α → α} {c : α → Prop} (hc : Lean.Order.chain c) (hi : ∀ (x : α), c x → Lean.Order.iterates f x) : Lean.Order.iterates f (Lean.Order.CCPO.csup c)
Instances For
The least fixpoint of a monotone function is the least upper bound of its transfinite iteration.
The monotone f
assumption is not strictly necessarily for the definition, but without this the
definition is not very meaningful and it simplifies applying theorems like fix_eq
if every use of
fix
already has the monotonicty requirement.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.fix f hmono = Lean.Order.CCPO.csup (Lean.Order.iterates f)
Instances For
The main fixpoint theorem for fixedpoints of monotone functions in chain-complete partial orders.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
The fixpoint induction theme: An admissible predicate holds for a least fixpoint if it is preserved by the fixpoint's function.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
- Lean.Order.instOrderPi = { rel := fun (f g : (x : α) → β x) => ∀ (x : α), Lean.Order.PartialOrder.rel (f x) (g x), rel_refl := ⋯, rel_trans := ⋯, rel_antisymm := ⋯ }
Equations
- Lean.Order.fun_csup c x = Lean.Order.CCPO.csup fun (y : β x) => ∃ (f : (x : α) → β x), c f ∧ f x = y
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Order.chain_pprod_fst c a = ∃ (b : β), c ⟨a, b⟩
Instances For
Equations
- Lean.Order.chain_pprod_snd c b = ∃ (a : α), c ⟨a, b⟩
Instances For
Equations
- Lean.Order.instCCPOPProd = Lean.Order.CCPO.mk (fun (c : α ×' β → Prop) => ⟨Lean.Order.CCPO.csup (Lean.Order.chain_pprod_fst c), Lean.Order.CCPO.csup (Lean.Order.chain_pprod_snd c)⟩) ⋯
FlatOrder b
wraps the type α
with the flat partial order generated by ∀ x, b ⊑ x
.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
Equations
Instances For
The flat partial order generated by ∀ x, b ⊑ x
.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
- bot {α : Sort u} {b : α} {x : Lean.Order.FlatOrder b} : Lean.Order.FlatOrder.rel b x
- refl {α : Sort u} {b : α} {x : Lean.Order.FlatOrder b} : x.rel x
Instances For
Equations
- Lean.Order.FlatOrder.instOrder = { rel := Lean.Order.FlatOrder.rel, rel_refl := ⋯, rel_trans := ⋯, rel_antisymm := ⋯ }
Equations
- Lean.Order.flat_csup c = if h : ∃ (x : Lean.Order.FlatOrder b), c x ∧ x ≠ b then Classical.choose h else b
Instances For
The class MonoBind m
indicates that every m α
has a PartialOrder
, and that the bind operation
on m
is monotone in both arguments with regard to that order.
This is intended to be used in the construction of partial_fixpoint
, and not meant to be used otherwise.
- bind_mono_left {α b : Type u} {a₁ a₂ : m α} {f : α → m b} (h : Lean.Order.PartialOrder.rel a₁ a₂) : Lean.Order.PartialOrder.rel (a₁ >>= f) (a₂ >>= f)
- bind_mono_right {α b : Type u} {a : m α} {f₁ f₂ : α → m b} (h : ∀ (x : α), Lean.Order.PartialOrder.rel (f₁ x) (f₂ x)) : Lean.Order.PartialOrder.rel (a >>= f₁) (a >>= f₂)
Instances
Equations
- Lean.Order.instPartialOrderExceptTOfMonad = inst (Except ε α)