# Lawful fixed point operators #

This module defines the laws required of a Fix instance, using the theory of omega complete partial orders (ωCPO). Proofs of the lawfulness of all Fix instances in Control.Fix are provided.

## Main definition #

• class LawfulFix
class LawfulFix (α : Type u_3) extends :
Type u_3

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
theorem LawfulFix.fix_eq {α : Type u_3} [self : ] {f : α →o α} :
Fix.fix f = f (Fix.fix f)
theorem LawfulFix.fix_eq' {α : Type u_3} [] {f : αα} :
= f ()
theorem Part.Fix.approx_mono' {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) {i : } :
Part.Fix.approx (f) i Part.Fix.approx (f) i.succ
theorem Part.Fix.approx_mono {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) ⦃i : ⦃j : (hij : i j) :
theorem Part.Fix.mem_iff {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) (a : α) (b : β a) :
b Part.fix (f) a ∃ (i : ), b Part.Fix.approx (f) i a
theorem Part.Fix.approx_le_fix {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) (i : ) :
theorem Part.Fix.exists_fix_le_approx {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) (x : α) :
∃ (i : ), Part.fix (f) x Part.Fix.approx (f) i x
def Part.Fix.approxChain {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) :

The series of approximations of fix f (see approx) as a Chain

Equations
• = { toFun := , monotone' := }
Instances For
theorem Part.Fix.le_f_of_mem_approx {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) {x : (a : α) → Part (β a)} :
x f x
theorem Part.Fix.approx_mem_approxChain {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) {i : } :
theorem Part.fix_eq_ωSup {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) :
theorem Part.fix_le {α : Type u_1} {β : αType u_2} (f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)) {X : (a : α) → Part (β a)} (hX : f X X) :
Part.fix f X
theorem Part.fix_eq {α : Type u_1} {β : αType u_2} {f : ((a : α) → Part (β a)) →o (a : α) → Part (β a)} :
Part.fix f = f (Part.fix f)
@[simp]
theorem Part.toUnitMono_coe {α : Type u_1} (f : Part α →o Part α) (x : UnitPart α) (u : Unit) :
() x u = f (x u)
def Part.toUnitMono {α : Type u_1} (f : Part α →o Part α) :
(UnitPart α) →o UnitPart α

toUnit as a monotone function

Equations
• = { toFun := fun (x : UnitPart α) (u : Unit) => f (x u), monotone' := }
Instances For
theorem Part.to_unit_cont {α : Type u_1} (f : Part α →o Part α) :
instance Part.lawfulFix {α : Type u_1} :
Equations
• Part.lawfulFix =
instance Pi.lawfulFix {α : Type u_1} {β : Type u_3} :
LawfulFix (αPart β)
Equations
• Pi.lawfulFix =
@[simp]
theorem Pi.monotoneCurry_coe (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → Preorder (γ x y)] (f : (x : (a : α) × β a) → γ x.fst x.snd) (x : α) (y : β x) :
() f x y = Sigma.curry f x y
def Pi.monotoneCurry (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → Preorder (γ x y)] :
((x : (a : α) × β a) → γ x.fst x.snd) →o (a : α) → (b : β a) → γ a b

Sigma.curry as a monotone function.

Equations
• = { toFun := Sigma.curry, monotone' := }
Instances For
@[simp]
theorem Pi.monotoneUncurry_coe (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → Preorder (γ x y)] (f : (x : α) → (y : β x) → γ x y) (x : (a : α) × β a) :
() f x =
def Pi.monotoneUncurry (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → Preorder (γ x y)] :
((a : α) → (b : β a) → γ a b) →o (x : (a : α) × β a) → γ x.fst x.snd

Sigma.uncurry as a monotone function.

Equations
• = { toFun := Sigma.uncurry, monotone' := }
Instances For
theorem Pi.continuous_curry (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)] :
theorem Pi.continuous_uncurry (α : Type u_1) (β : αType u_2) (γ : (a : α) → β aType u_3) [(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)] :
instance Pi.hasFix {α : Type u_1} {β : αType u_2} {γ : (a : α) → β aType u_3} [Fix ((x : ) → γ x.fst x.snd)] :
Fix ((x : α) → (y : β x) → γ x y)
Equations
• Pi.hasFix = { fix := fun (f : ((x : α) → (y : β x) → γ x y)(x : α) → (y : β x) → γ x y) => Sigma.curry (Fix.fix (Sigma.uncurry f Sigma.curry)) }
theorem Pi.uncurry_curry_continuous {α : Type u_1} {β : αType u_2} {γ : (a : α) → β aType u_3} [(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)] {f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y} :
instance Pi.lawfulFix' {α : Type u_1} {β : αType u_2} {γ : (a : α) → β aType u_3} [(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)] [LawfulFix ((x : ) → γ x.fst x.snd)] :
LawfulFix ((x : α) → (y : β x) → γ x y)
Equations
• Pi.lawfulFix' =