Lawful fixed point operators #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This module defines the laws required of a has_fix
instance, using the theory of
omega complete partial orders (ωCPO). Proofs of the lawfulness of all has_fix
instances in
control.fix
are provided.
Main definition #
- class
lawful_fix
- to_has_fix : has_fix α
- fix_eq : ∀ {f : α →o α}, omega_complete_partial_order.continuous f → has_fix.fix ⇑f = ⇑f (has_fix.fix ⇑f)
Intuitively, a fixed point operator fix
is lawful if it satisfies fix f = f (fix f)
for all
f
, but this is inconsistent / uninteresting in most cases due to the existence of "exotic"
functions f
, such as the function that is defined iff its argument is not, familiar from the
halting problem. Instead, this requirement is limited to only functions that are continuous
in the
sense of ω
-complete partial orders, which excludes the example because it is not monotone
(making the input argument less defined can make f
more defined).
Instances of this typeclass
Instances of other typeclasses for lawful_fix
- lawful_fix.has_sizeof_inst
The series of approximations of fix f
(see approx
) as a chain
Equations
- part.fix.approx_chain f = {to_fun := part.fix.approx ⇑f, monotone' := _}
Equations
- part.lawful_fix = {to_has_fix := part.has_fix α, fix_eq := _}
Equations
- pi.lawful_fix = {to_has_fix := pi.part.has_fix β, fix_eq := _}
sigma.curry
as a monotone function.
Equations
- pi.monotone_curry α β γ = {to_fun := sigma.curry γ, monotone' := _}
sigma.uncurry
as a monotone function.
Equations
- pi.monotone_uncurry α β γ = {to_fun := sigma.uncurry (λ (a : α) (b : β a), γ a b), monotone' := _}
Equations
- pi.has_fix = {fix := λ (f : (Π (x : α) (y : β x), γ x y) → Π (x : α) (y : β x), γ x y), sigma.curry (has_fix.fix (sigma.uncurry ∘ f ∘ sigma.curry))}