Documentation

CslibFrontier.Foundations.Relation.DerivationHeight

Derivation Height and Worst-Case Complexity of Reduction Relations #

This module extends Cslib.Foundations.Relation.RelatesInSteps and Cslib.Foundations.Relation.Termination with ℕ∞-valued derivation height and size-indexed worst-case complexity functions for abstract binary reduction relations r : α → α → Prop, including the dynamic-programming Bellman equation, König's lemma for finitely branching strongly normalizing relations, and quantitative upper bounds from ℕ-valued step measures.

Main definitions #

Main results #

noncomputable def Relation.derivationHeight {α : Type u} (r : α → α → Prop) (a : α) :

The derivation height of a : α with respect to a reduction relation r : α → α → Prop, valued in ℕ∞: the supremum of all step counts n : ℕ for which there exists b : α with _root_.Relation.RelatesInSteps r a b n.

theorem Relation.le_derivationHeight_of_relatesInSteps {α : Type u} {r : α → α → Prop} {a b : α} {n : ℕ} (h : RelatesInSteps r a b n) :

Any n-step walk from a to b witnesses (n : ℕ∞) ≤ derivationHeight r a.

theorem Relation.derivationHeight_le_iff {α : Type u} {r : α → α → Prop} {a : α} {k : ℕ∞} :
derivationHeight r a ≤ k ↔ ∀ (n : ℕ) (b : α), RelatesInSteps r a b n → ↑n ≤ k

Upper-bound characterization of derivationHeight.

theorem Relation.exists_relatesInSteps_of_derivationHeight_eq_coe {α : Type u} {r : α → α → Prop} {a : α} {m : ℕ} (h : derivationHeight r a = ↑m) :
∃ (b : α), RelatesInSteps r a b m

Every finite value (m : ℕ∞) of derivationHeight r a is attained by an explicit m-step reduction sequence starting at a.

theorem Relation.derivationHeight_eq_zero_of_normal {α : Type u} {r : α → α → Prop} {a : α} (hn : Normal r a) :

If a is a normal form of r, then derivationHeight r a = 0.

theorem Relation.derivationHeight_eq_zero_iff {α : Type u} {r : α → α → Prop} {a : α} :

derivationHeight r a = 0 if and only if a is a normal form of r.

theorem Relation.add_one_le_derivationHeight_of_rel {α : Type u} {r : α → α → Prop} {a b : α} (hab : r a b) :

A single reduction step r a b satisfies derivationHeight r b + 1 ≤ derivationHeight r a.

theorem Relation.derivationHeight_eq_iSup_succ {α : Type u} (r : α → α → Prop) (a : α) :

Dynamic-programming recurrence for derivationHeight.

theorem Relation.derivationHeight_lt_top_of_sn {α : Type u} {r : α → α → Prop} (hfb : ∀ (x : α), (successors r x).Finite) {a : α} (hsn : SN r a) :

König's lemma (forward direction) for finitely branching relations.

theorem Relation.sn_of_derivationHeight_lt_top {α : Type u} {r : α → α → Prop} {a : α} (h : derivationHeight r a < ⊤) :
SN r a

Finite derivation height implies strong normalization.

theorem Relation.derivationHeight_lt_top_iff_sn {α : Type u} {r : α → α → Prop} (hfb : ∀ (x : α), (successors r x).Finite) {a : α} :

König's lemma for finitely branching reduction relations: derivationHeight r a < ⊤ ↔ Relation.SN r a.

theorem Relation.derivationHeight_le_of_step_measure {α : Type u} {r : α → α → Prop} (Φ : α → ℕ) {a : α} (hstep : ∀ (x y : α), ReflTransGen r a x → r x y → Φ y < Φ x) :
derivationHeight r a ≤ ↑(Φ a)

Quantitative step-measure bound on derivationHeight.

noncomputable def Relation.complexity {α : Type u} (size : α → ℕ) (r : α → α → Prop) (T : Set α) (n : ℕ) :

Worst-case derivation complexity comp(n, r, T) over initial states s ∈ T of size size s ≤ n.

theorem Relation.complexity_le_iff {α : Type u} {size : α → ℕ} {r : α → α → Prop} {T : Set α} {n : ℕ} {k : ℕ∞} :
complexity size r T n ≤ k ↔ ∀ s ∈ T, size s ≤ n → derivationHeight r s ≤ k

Upper-bound characterization of complexity.

theorem Relation.complexity_le_of_step_measure {α : Type u} {size : α → ℕ} {r : α → α → Prop} {T : Set α} (Φ : α → ℕ) (hstep : ∀ s ∈ T, ∀ (x y : α), ReflTransGen r s x → r x y → Φ y < Φ x) {n B : ℕ} (hbound : ∀ s ∈ T, size s ≤ n → Φ s ≤ B) :
complexity size r T n ≤ ↑B

Quantitative ℕ upper bound on complexity from a strictly decreasing reachable step measure Φ : α → ℕ.