# mathlibdocumentation

control.lawful_fix

# Lawful fixed point operators

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
@[class]
structure lawful_fix (α : Type u_3)  :
Type u_3
• to_has_fix :
• fix_eq : ∀ {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
theorem lawful_fix.fix_eq' {α : Type u_1} [lawful_fix α] {f : α → α} :

theorem roption.fix.approx_mono' {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) {i : } :

theorem roption.fix.approx_mono {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) ⦃i j :  :
i j

theorem roption.fix.mem_iff {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) (a : α) (b : β a) :
b a ∃ (i : ), b a

theorem roption.fix.approx_le_fix {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) (i : ) :

theorem roption.fix.exists_fix_le_approx {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) (x : α) :
∃ (i : ), x x

def roption.fix.approx_chain {α : Type u_1} {β : α → Type u_2} :
((Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a))omega_complete_partial_order.chain (Π (a : α), roption (β a))

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

Equations
theorem roption.fix.le_f_of_mem_approx {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) {x : Π (a : α), roption (β a)} :
x f x

theorem roption.fix.approx_mem_approx_chain {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) {i : } :

theorem roption.fix_eq_ωSup {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) :

theorem roption.fix_le {α : Type u_1} {β : α → Type u_2} (f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)) {X : Π (a : α), roption (β a)} :
f X X

theorem roption.fix_eq {α : Type u_1} {β : α → Type u_2} {f : (Π (a : α), roption (β a)) →ₘ Π (a : α), roption (β a)} :

@[simp]
theorem roption.to_unit_mono_to_fun {α : Type u_1} (f : →ₘ ) (x : unit) (u : unit) :
u = f (x u)

def roption.to_unit_mono {α : Type u_1} :
(roption α →ₘ roption α)(unitroption α) →ₘ unit

to_unit as a monotone function

Equations
theorem roption.to_unit_cont {α : Type u_1} (f : →ₘ ) :

@[instance]
def roption.lawful_fix {α : Type u_1} :

Equations
@[instance]
def pi.lawful_fix {α : Type u_1} {β : Type u_2} :
lawful_fix (α → roption β)

Equations
@[simp]
theorem pi.monotone_curry_to_fun (α : 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 = x y

def pi.monotone_curry (α : Type u_1) (β : α → Type u_2) (γ : Π (a : α), β aType u_3) [Π (x : α) (y : β x), preorder (γ x y)] :
(Π (x : Σ (a : α), β a), γ x.fst x.snd) →ₘ Π (a : α) (b : β a), γ a b

sigma.curry as a monotone function.

Equations
def pi.monotone_uncurry (α : Type u_1) (β : α → Type u_2) (γ : Π (a : α), β aType u_3) [Π (x : α) (y : β x), preorder (γ x y)] :
(Π (a : α) (b : β a), γ a b) →ₘ Π (x : Σ (a : α), β a), γ x.fst x.snd

sigma.uncurry as a monotone function.

Equations
@[simp]
theorem pi.monotone_uncurry_to_fun (α : Type u_1) (β : α → Type u_2) (γ : Π (a : α), β aType u_3) [Π (x : α) (y : β x), preorder (γ x y)] (f : Π (x : α) (y : (λ (a : α), β a) x), (λ (a : α) (b : β a), γ a b) x y) (x : Σ (a : α), β a) :
γ) f x =

theorem pi.continuous_curry (α : Type u_1) (β : α → Type u_2) (γ : Π (a : α), β aType u_3) [Π (x : α) (y : β x), omega_complete_partial_order (γ x y)] :

theorem pi.continuous_uncurry (α : Type u_1) (β : α → Type u_2) (γ : Π (a : α), β aType u_3) [Π (x : α) (y : β x), omega_complete_partial_order (γ x y)] :

@[instance]
def pi.has_fix {α : Type u_1} {β : α → Type u_2} {γ : Π (a : α), β aType u_3} [has_fix (Π (x : σ β), γ x.fst x.snd)] :
has_fix (Π (x : α) (y : β x), γ x y)

Equations
• pi.has_fix = {fix := λ (f : (Π (x : α) (y : β x), γ x y)Π (x : α) (y : β x), γ x y),
theorem pi.uncurry_curry_continuous {α : Type u_1} {β : α → Type u_2} {γ : Π (a : α), β aType u_3} [Π (x : α) (y : β x), omega_complete_partial_order (γ x y)] {f : (Π (x : α) (y : β x), γ x y) →ₘ Π (x : α) (y : β x), γ x y} :

@[instance]
def pi.pi.lawful_fix' {α : Type u_1} {β : α → Type u_2} {γ : Π (a : α), β aType u_3} [Π (x : α) (y : β x), omega_complete_partial_order (γ x y)] [lawful_fix (Π (x : σ β), γ x.fst x.snd)] :
lawful_fix (Π (x : α) (y : β x), γ x y)

Equations