Explicit Cunningham lower-bound constructions
Definitionfriedmann_cunninghamExplicit graph-derived Avis–Friedmann family: source-specific cyclic column ordering, prescribed exceptional initial action, collapsed absorbing MDP, exact parity graph with repeated-priority semantics, policy-to-basis map, and actual polytope realizability/AUSO/cube-walk predicates.
import Definitions.Def_friedmann_simplex
import Definitions.Def_friedmann_multiplicity
import Lean.Elab.Tactic.Omega
set_option autoImplicit false
/-! Linear programs derived from Avis–Friedmann's Figure 7 via §4.2. Column numbers are
the cyclic ordering (1), rather than an arbitrary enumeration. Parameters n<3
are given total definitions but are excluded from every paper-level target.
The reward contribution of the aliases b₁=c₁=g₁ is retained explicitly; see
notes/cunningham-source-crosswalk.txt for the discrepancy with displayed §4.4.
-/
namespace FriedmannCunningham
open FriedmannSimplex
open scoped BigOperators
open Matrix
inductive Kind where
| a | b | c | d | e
deriving DecidableEq
structure Name where
kind : Kind
level : ℕ
one : Bool
deriving DecidableEq
def rows (n : ℕ) : ℕ := 5 * (n - 1)
def cols (n : ℕ) : ℕ := 10 * (n - 1)
def rowName (n : ℕ) (r : Fin (rows n)) : Kind × ℕ :=
if r.val < n - 1 then (.a, r.val + 2)
else if r.val < (n - 1) + (n - 2) then (.b, r.val - (n - 1) + 2)
else if r.val < 2 * (n - 1) + (n - 2) then
(.c, r.val - ((n - 1) + (n - 2)) + 2)
else if r.val < 3 * (n - 1) + (n - 2) then
(.d, r.val - (2 * (n - 1) + (n - 2)) + 2)
else (.e, r.val - (3 * (n - 1) + (n - 2)) + 1)
def columnName (n : ℕ) (j : Fin (cols n)) : Name :=
let k := j.val
if k = 0 then ⟨.e, 1, true⟩
else if k < 4 * n - 5 then
let i := (k - 1) / 4 + 2
match (k - 1) % 4 with
| 0 => ⟨.d, i, false⟩
| 1 => ⟨.e, i, true⟩
| 2 => ⟨.b, i, true⟩
| _ => ⟨.b, i, false⟩
else if k < 6 * n - 7 then
⟨.c, (k - (4 * n - 5)) / 2 + 2, decide ((k - (4 * n - 5)) % 2 = 1)⟩
else if k < 7 * n - 7 then ⟨.e, k - (6 * n - 7) + 1, false⟩
else if k < 8 * n - 8 then ⟨.d, k - (7 * n - 7) + 2, true⟩
else ⟨.a, n - (k - (8 * n - 8)) / 2, decide ((k - (8 * n - 8)) % 2 = 0)⟩
def columnRank (n : ℕ) (v : Name) : ℕ :=
match v.kind, v.one with
| .e, true => if v.level = 1 then 0 else 4 * (v.level - 2) + 2
| .d, false => 4 * (v.level - 2) + 1
| .b, true => 4 * (v.level - 2) + 3
| .b, false => 4 * (v.level - 2) + 4
| .c, false => 4 * n - 5 + 2 * (v.level - 2)
| .c, true => 4 * n - 5 + 2 * (v.level - 2) + 1
| .e, false => 6 * n - 7 + (v.level - 1)
| .d, true => 7 * n - 7 + (v.level - 2)
| .a, true => 8 * n - 8 + 2 * (n - v.level)
| .a, false => 8 * n - 8 + 2 * (n - v.level) + 1
def indicator (v : Name) (kind : Kind) (i : ℕ) (one : Bool) : ℚ :=
if v = ⟨kind, i, one⟩ then 1 else 0
def scale (n : ℕ) : ℚ := 2 * n + 1
def epsilon (n : ℕ) : ℚ := 1 / scale n ^ (2 * n + 2)
def rewardG (n i : ℕ) : ℚ := (-scale n) ^ (2 * i - 1)
def rewardH (n i : ℕ) : ℚ := (-scale n) ^ (2 * i)
/-- Coefficient of a named action in the displayed conservation equation. -/
def coefficient (n : ℕ) (r : Kind × ℕ) (v : Name) : ℚ :=
let i := r.2
let x := fun k l b => indicator v k l b
let own := x r.1 i false + x r.1 i true
let active := x .a i true + x .b i true + x .c i true +
x .d i true + x .e i true
match r.1 with
| .a =>
if i = 2 then own - epsilon n *
(x .b 2 false + x .c 2 false + x .d 2 false + x .e 1 true)
else own - x .a (i - 1) false - epsilon n *
(x .a (i - 1) true + x .b (i - 1) true + x .c (i - 1) true +
x .d (i - 1) true + x .e (i - 1) true)
| .b => own - x .b (i + 1) false - x .d (i + 1) false
| .c =>
if i = n then own - ∑ j ∈ Finset.range (n + 1), x .e j false
else own - x .c (i + 1) false
| .d => own - (1 - epsilon n) / 2 * active
| .e =>
if i = 1 then own - (1 - epsilon n) *
(x .b 2 false + x .c 2 false + x .d 2 false + x .e 1 true)
else own - (1 - epsilon n) / 2 * active
def objectiveCoefficient (n : ℕ) (v : Name) : ℚ :=
(match v.kind, v.one with
| .a, true | .b, true | .c, true => rewardG n v.level + epsilon n * rewardH n v.level
| .d, true | .e, true => epsilon n * rewardH n v.level
| .e, false => 1
| _, _ => 0) +
(rewardG n 1 + epsilon n * rewardH n 1) *
(indicator v .b 2 false + indicator v .c 2 false + indicator v .d 2 false)
def program (n : ℕ) : LP (rows n) (cols n) where
A r j := coefficient n (rowName n r) (columnName n j)
b _ := 1
c j := objectiveCoefficient n (columnName n j)
def initialBit (r : Kind × ℕ) : Bool :=
r.1 == .d || (r.1 == .e && r.2 == 1)
def initialBasis (n : ℕ) (hn : 3 ≤ n) : Basis (rows n) (cols n) :=
fun r =>
let name := rowName n r
⟨columnRank n ⟨name.1, name.2, initialBit name⟩ % cols n, by
apply Nat.mod_lt
unfold cols
omega⟩
def initialState (n : ℕ) (hn : 3 ≤ n) : State (rows n) (cols n) where
basis := initialBasis n hn
last := ⟨0, by unfold cols; omega⟩
/-- The order is identity because column numbers already follow (1). -/
def order (n : ℕ) : Fin (cols n) ≃ Fin (cols n) := Equiv.refl _
def rowRank (n : ℕ) (r : Kind × ℕ) : ℕ :=
match r.1 with
| .a => r.2 - 2
| .b => (n - 1) + (r.2 - 2)
| .c => (n - 1) + (n - 2) + (r.2 - 2)
| .d => 2 * (n - 1) + (n - 2) + (r.2 - 2)
| .e => 3 * (n - 1) + (n - 2) + (r.2 - 1)
def actionColumn (n : ℕ) (hn : 3 ≤ n) (r : Fin (rows n)) (one : Bool) :
Fin (cols n) :=
let name := rowName n r
⟨columnRank n ⟨name.1, name.2, one⟩ % cols n, by
apply Nat.mod_lt
unfold cols
omega⟩
abbrev Policy (n : ℕ) := Fin (rows n) → Bool
def policyBasis (n : ℕ) (hn : 3 ≤ n) (σ : Policy n) : Basis (rows n) (cols n) :=
fun r => actionColumn n hn r (σ r)
def initialPolicy (n : ℕ) : Policy n := fun r => initialBit (rowName n r)
/-- Transition probabilities between decision vertices after eliminating the
intermediate random vertices. The missing mass goes to the absorbing sink. -/
def transition (n : ℕ) (hn : 3 ≤ n) (r : Fin (rows n)) (one : Bool)
(q : Fin (rows n)) : ℚ :=
(if q = r then 1 else 0) - (program n).A q (actionColumn n hn r one)
def actionReward (n : ℕ) (hn : 3 ≤ n) (r : Fin (rows n)) (one : Bool) : ℚ :=
(program n).c (actionColumn n hn r one)
noncomputable def policyValue (n : ℕ) (hn : 3 ≤ n) (σ : Policy n) :
Fin (rows n) → ℚ :=
(basisMatrix (program n) (policyBasis n hn σ))ᵀ⁻¹ *ᵥ
(fun r => actionReward n hn r (σ r))
noncomputable def mdpImproving (n : ℕ) (hn : 3 ≤ n) (σ : Policy n)
(r : Fin (rows n)) : Prop :=
policyValue n hn σ r < actionReward n hn r (!σ r) +
∑ q : Fin (rows n), transition n hn r (!σ r) q * policyValue n hn σ q
structure MDPState (n : ℕ) where
policy : Policy n
last : Fin (cols n)
noncomputable def mdpStep (n : ℕ) (hn : 3 ≤ n) (s s' : MDPState n) : Prop :=
∃ r, mdpImproving n hn s.policy r ∧
(∀ q, mdpImproving n hn s.policy q →
cyclicDistance (order n) s.last (actionColumn n hn r (!s.policy r)) ≤
cyclicDistance (order n) s.last (actionColumn n hn q (!s.policy q))) ∧
s'.policy = Function.update s.policy r (!s.policy r) ∧
s'.last = actionColumn n hn r (!s.policy r)
def initialMDPState (n : ℕ) (hn : 3 ≤ n) : MDPState n where
policy := initialPolicy n
last := ⟨0, by unfold cols; omega⟩
noncomputable def mdpRun (n : ℕ) (hn : 3 ≤ n) (s : ℕ → MDPState n) (T : ℕ) : Prop :=
s 0 = initialMDPState n hn ∧
(∀ t, t < T → mdpStep n hn (s t) (s (t + 1))) ∧
∀ r, ¬mdpImproving n hn (s T).policy r
def cubeAdjacent (n : ℕ) (σ τ : Policy n) : Prop :=
∃ r, σ r ≠ τ r ∧ ∀ q, q ≠ r → σ q = τ q
def inCubeFace (n : ℕ) (face : Fin (rows n) → Option Bool) (σ : Policy n) : Prop :=
∀ r b, face r = some b → σ r = b
noncomputable def cubeOrientation (n : ℕ) (hn : 3 ≤ n)
(c : Fin (cols n) → ℚ) (σ τ : Policy n) : Prop :=
cubeAdjacent n σ τ ∧
objective { program n with c := c } (basicPoint (program n) (policyBasis n hn σ)) <
objective { program n with c := c } (basicPoint (program n) (policyBasis n hn τ))
noncomputable def isAUSO (n : ℕ) (hn : 3 ≤ n) (c : Fin (cols n) → ℚ) : Prop :=
(∀ σ τ, cubeAdjacent n σ τ →
cubeOrientation n hn c σ τ ∨ cubeOrientation n hn c τ σ) ∧
(∀ σ, ¬Relation.TransGen (cubeOrientation n hn c) σ σ) ∧
∀ face, ∃! σ, inCubeFace n face σ ∧
∀ τ, inCubeFace n face τ → ¬cubeOrientation n hn c σ τ
def isVertex {m k : ℕ} (P : LP m k) (x : Fin k → ℚ) : Prop :=
feasible P x ∧ ∀ y z, feasible P y → feasible P z →
(∀ j, x j = (y j + z j) / 2) → y = x ∧ z = x
def polytopeAdjacent {m k : ℕ} (P : LP m k) (x y : Fin k → ℚ) : Prop :=
x ≠ y ∧ isVertex P x ∧ isVertex P y ∧
∀ z, feasible P z →
(∀ j, x j = 0 → y j = 0 → z j = 0) →
∃ t : ℚ, 0 ≤ t ∧ t ≤ 1 ∧ ∀ j, z j = (1 - t) * x j + t * y j
/-- Realization uses actual extreme points and one-dimensional faces of the
feasible rational polytope, rather than a graph postulated as an extra field. -/
noncomputable def realizesCube (n : ℕ) (hn : 3 ≤ n) : Prop :=
bounded (program n) ∧
(∀ σ, isVertex (program n) (basicPoint (program n) (policyBasis n hn σ))) ∧
(∀ x, isVertex (program n) x →
∃! σ, basicPoint (program n) (policyBasis n hn σ) = x) ∧
∀ σ τ, cubeAdjacent n σ τ ↔
polytopeAdjacent (program n) (basicPoint (program n) (policyBasis n hn σ))
(basicPoint (program n) (policyBasis n hn τ))
noncomputable def cubeStep (n : ℕ) (hn : 3 ≤ n) (c : Fin (cols n) → ℚ)
(s s' : MDPState n) : Prop :=
∃ r, cubeOrientation n hn c s.policy (Function.update s.policy r (!s.policy r)) ∧
(∀ q, cubeOrientation n hn c s.policy (Function.update s.policy q (!s.policy q)) →
cyclicDistance (order n) s.last (actionColumn n hn r (!s.policy r)) ≤
cyclicDistance (order n) s.last (actionColumn n hn q (!s.policy q))) ∧
s'.policy = Function.update s.policy r (!s.policy r) ∧
s'.last = actionColumn n hn r (!s.policy r)
noncomputable def cubeRun (n : ℕ) (hn : 3 ≤ n) (c : Fin (cols n) → ℚ)
(s : ℕ → MDPState n) (T : ℕ) : Prop :=
s 0 = initialMDPState n hn ∧
(∀ t, t < T → cubeStep n hn c (s t) (s (t + 1))) ∧
∀ τ, ¬cubeOrientation n hn c (s T).policy τ
/- The parity-game companion uses the source's repeated priorities. -/
def vertices (n : ℕ) : ℕ := rows n + 3 * n + 2
def vertexCode (n : ℕ) (k : ℕ) : Fin (vertices n) :=
⟨k % vertices n, Nat.mod_lt _ (by unfold vertices; omega)⟩
def sinkVertex (n : ℕ) : Fin (vertices n) := vertexCode n (rows n + 3 * n + 1)
def sVertex (n : ℕ) : Fin (vertices n) := vertexCode n (rows n + 3 * n)
def fVertex (n i : ℕ) : Fin (vertices n) := vertexCode n (rows n + (i - 1))
def gVertex (n i : ℕ) : Fin (vertices n) := vertexCode n (rows n + n + (i - 1))
def hVertex (n i : ℕ) : Fin (vertices n) := vertexCode n (rows n + 2 * n + (i - 1))
def decisionVertex (n : ℕ) (k : Kind) (i : ℕ) : Fin (vertices n) :=
if k = .a ∧ i = n + 1 then sinkVertex n
else if (k = .b ∨ k = .c) ∧ i = 1 then gVertex n 1
else vertexCode n (rowRank n (k, i))
def actionSource (n : ℕ) (j : Fin (cols n)) : Fin (vertices n) :=
let v := columnName n j
decisionVertex n v.kind v.level
def actionTarget (n : ℕ) (v : Name) : Fin (vertices n) :=
match v.kind, v.one with
| .a, true | .b, true | .c, true => gVertex n v.level
| .a, false => decisionVertex n .a (v.level + 1)
| .b, false | .d, false => decisionVertex n .b (v.level - 1)
| .c, false => decisionVertex n .c (v.level - 1)
| .d, true | .e, true => fVertex n v.level
| .e, false => sVertex n
def gameSuccessors (n : ℕ) (v : Fin (vertices n)) : Finset (Fin (vertices n)) :=
if hv : v.val < rows n then
let r := rowName n ⟨v.val, hv⟩
{actionTarget n ⟨r.1, r.2, false⟩, actionTarget n ⟨r.1, r.2, true⟩}
else if v.val < rows n + n then
let i := v.val - rows n + 1
if i = 1 then {hVertex n i, decisionVertex n .e i}
else {hVertex n i, decisionVertex n .d i, decisionVertex n .e i}
else if v.val < rows n + 2 * n then
{fVertex n (v.val - (rows n + n) + 1)}
else if v.val < rows n + 3 * n then
{decisionVertex n .a (v.val - (rows n + 2 * n) + 2)}
else if v = sVertex n then {decisionVertex n .c n}
else {sinkVertex n}
def gamePriority (n : ℕ) (v : Fin (vertices n)) : ℕ :=
if hv : v.val < rows n then
match (rowName n ⟨v.val, hv⟩).1 with
| .a | .b | .c => 3
| .d | .e => 5
else if v.val < rows n + n then 6
else if v.val < rows n + 2 * n then 2 * (v.val - (rows n + n) + 1) + 7
else if v.val < rows n + 3 * n then 2 * (v.val - (rows n + 2 * n) + 1) + 8
else if v = sVertex n then 8
else 1
def parityGame (n : ℕ) : FriedmannParity.Game (Fin (vertices n)) where
owner v := decide (rows n ≤ v.val)
priority := gamePriority n
edge v w := w ∈ gameSuccessors n v
def initialStrategy (n : ℕ) : Fin (vertices n) → Fin (vertices n) := fun v =>
if hv : v.val < rows n then
let r := rowName n ⟨v.val, hv⟩
actionTarget n ⟨r.1, r.2, initialBit r⟩
else v
structure ParityState (n : ℕ) where
strategy : Fin (vertices n) → Fin (vertices n)
last : Fin (cols n)
def initialParityState (n : ℕ) (hn : 3 ≤ n) : ParityState n where
strategy := initialStrategy n
last := ⟨0, by unfold cols; omega⟩
def parityStep (n : ℕ) (s s' : ParityState n) : Prop :=
∃ j : Fin (cols n),
FriedmannMultiplicity.Improving (parityGame n) s.strategy
(actionSource n j) (actionTarget n (columnName n j)) ∧
(∀ k : Fin (cols n),
FriedmannMultiplicity.Improving (parityGame n) s.strategy
(actionSource n k) (actionTarget n (columnName n k)) →
cyclicDistance (order n) s.last j ≤ cyclicDistance (order n) s.last k) ∧
s'.strategy = Function.update s.strategy (actionSource n j)
(actionTarget n (columnName n j)) ∧ s'.last = j
def parityRun (n : ℕ) (hn : 3 ≤ n) (s : ℕ → ParityState n) (T : ℕ) : Prop :=
s 0 = initialParityState n hn ∧
(∀ t, t ≤ T → FriedmannParity.Legal (parityGame n) false (s t).strategy) ∧
(∀ t, t < T → parityStep n (s t) (s (t + 1))) ∧
¬FriedmannMultiplicity.Improvable (parityGame n) (s T).strategy
end FriedmannCunningham
Read-back
What the Lean code literally says, in plain math · Codex independent auditor (model identifier unavailable)
Kind. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality.
Name. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable.
rows. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus .
cols. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of columns is ; write for its finite index set. Thus .
rowName. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or .
columnName. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or .
columnRank. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by .
indicator. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise.
scale. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero.
epsilon. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number .
rewardG. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every pair , define the rational reward . In particular, because its exponent is zero.
rewardH. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every pair , define the rational reward . In particular, .
coefficient. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program.
objectiveCoefficient. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges.
program. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty.
initialBit. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every pair , define the Boolean to be exactly when or both and , and to be otherwise.
initialBasis. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , the number of columns is ; write for its finite index set. Thus . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every and every supplied proof of , define by , where . A basis here is merely a function from row indices to column indices; injectivity, nonsingularity, and feasibility are not fields of this type. The bound makes , so the remainder is a column index.
initialState. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , the number of columns is ; write for its finite index set. Thus . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every and every supplied proof of , define by , where . A basis here is merely a function from row indices to column indices; injectivity, nonsingularity, and feasibility are not fields of this type. The bound makes , so the remainder is a column index. For every and every supplied proof of , the initial simplex state is the pair . A simplex state consists of an arbitrary row-to-column function and a last-column index in ; the inequality supplies the validity of the index .
order. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of columns is ; write for its finite index set. Thus . For every , the ordering equivalence on is the identity , including the empty equivalence when or .
rowRank. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count.
actionColumn. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , the number of columns is ; write for its finite index set. Thus . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of .
Policy. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function.
policyBasis. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , the number of columns is ; write for its finite index set. Thus . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition.
initialPolicy. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the initial policy is for each ; equivalently it selects exactly on rows of kind and on the row of kind and level , and selects on all other rows. This is the empty function if or .
transition. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , every pair of rows , and every Boolean , define the rational number , where is when and otherwise. The definition itself includes no assertion about its sign or about any sum of such numbers.
actionReward. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , every row , and every Boolean , define the rational action reward .
policyValue. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For every , every supplied proof of , every row , and every Boolean , define the rational action reward . For every , every supplied proof of , and every policy , form the square matrix indexed by in both coordinates, with . Define the rational value vector . The inverse is total; no invertibility hypothesis is imposed.
mdpImproving. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For every , every supplied proof of , every row , and every Boolean , define the rational action reward . For every , every supplied proof of , and every policy , form the square matrix indexed by in both coordinates, with . Define the rational value vector . The inverse is total; no invertibility hypothesis is imposed. For every , every supplied proof of , every pair of rows , and every Boolean , define the rational number , where is when and otherwise. The definition itself includes no assertion about its sign or about any sum of such numbers. For every , every supplied proof of , every policy , and every row , the row is improving precisely when . The comparison is strict, and it compares the opposite Boolean action with the displayed total-inverse value.
MDPState. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty.
mdpStep. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For every , every supplied proof of , every row , and every Boolean , define the rational action reward . For every , every supplied proof of , and every policy , form the square matrix indexed by in both coordinates, with . Define the rational value vector . The inverse is total; no invertibility hypothesis is imposed. For every , every supplied proof of , every pair of rows , and every Boolean , define the rational number , where is when and otherwise. The definition itself includes no assertion about its sign or about any sum of such numbers. For every , every supplied proof of , every policy , and every row , the row is improving precisely when . The comparison is strict, and it compares the opposite Boolean action with the displayed total-inverse value. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every , every supplied proof of , and any two MDP states and , an MDP step holds exactly when there exists such that is improving for , for every that is improving for one has , the new policy is and for all , and . The comparison with every other improving row uses a non-strict inequality.
initialMDPState. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial policy is for each ; equivalently it selects exactly on rows of kind and on the row of kind and level , and selects on all other rows. This is the empty function if or . For every and every supplied proof of , the initial MDP state is , with .
mdpRun. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For every , every supplied proof of , every row , and every Boolean , define the rational action reward . For every , every supplied proof of , and every policy , form the square matrix indexed by in both coordinates, with . Define the rational value vector . The inverse is total; no invertibility hypothesis is imposed. For every , every supplied proof of , every pair of rows , and every Boolean , define the rational number , where is when and otherwise. The definition itself includes no assertion about its sign or about any sum of such numbers. For every , every supplied proof of , every policy , and every row , the row is improving precisely when . The comparison is strict, and it compares the opposite Boolean action with the displayed total-inverse value. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every , every supplied proof of , and any two MDP states and , an MDP step holds exactly when there exists such that is improving for , for every that is improving for one has , the new policy is and for all , and . The comparison with every other improving row uses a non-strict inequality. For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial policy is for each ; equivalently it selects exactly on rows of kind and on the row of kind and level , and selects on all other rows. This is the empty function if or . For every and every supplied proof of , the initial MDP state is , with . For every , every supplied proof of , every sequence , and every , the MDP-run predicate holds exactly when , for every natural the MDP-step predicate holds from to , and no row is improving for the policy component of . This is a predicate on the specified , not an existence assertion. It permits exactly when the initial policy has no improving row; values of for are unrestricted by this predicate.
cubeAdjacent. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row .
inCubeFace. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , every face specification , and every policy , membership in the face means that for every and every Boolean , the equality implies . A value imposes no condition on that coordinate. The specifications include the whole cube (all values ) and faces fixing every coordinate. When is empty the condition is vacuous.
cubeOrientation. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row . The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For and a policy , put , , and for every . This is the basic point of the row-to-column function: repeated selected columns, if any, contribute by summation. The inverse is total, and these formulas alone impose no feasibility or determinant condition. For every , every supplied proof of , every rational vector , and every two policies , the directed relation holds exactly when they are cube-adjacent and . The basic points in this comparison are formed from with its original matrix and right-hand side; only the objective coefficients in the sums are replaced by . The comparison is strict, so equality of the two sums gives no directed edge in either direction.
isAUSO. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row . The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For and a policy , put , , and for every . This is the basic point of the row-to-column function: repeated selected columns, if any, contribute by summation. The inverse is total, and these formulas alone impose no feasibility or determinant condition. For every , every supplied proof of , every rational vector , and every two policies , the directed relation holds exactly when they are cube-adjacent and . The basic points in this comparison are formed from with its original matrix and right-hand side; only the objective coefficients in the sums are replaced by . The comparison is strict, so equality of the two sums gives no directed edge in either direction. For every , every face specification , and every policy , membership in the face means that for every and every Boolean , the equality implies . A value imposes no condition on that coordinate. The specifications include the whole cube (all values ) and faces fixing every coordinate. When is empty the condition is vacuous. For every , every supplied proof of , and every rational objective vector , the AUSO predicate is the conjunction of these three conditions: for every pair of policies that are cube-adjacent, either or ; for every policy , there is no nonempty finite path of edges from back to itself; and for every face specification , there exists exactly one policy such that belongs to that face and, for every policy belonging to the same face, does not hold. The last condition includes the entire cube and singleton faces, and its uniqueness ranges over all policies satisfying both stated requirements.
isVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every pair of natural numbers , every rational linear-program datum with , , and , and every , define to be a vertex precisely when and for all , and the following implication holds for every : if , for all , , for all , and for every , then and . The coordinate sets may be empty; the definition requires itself to be feasible, and does not use the objective vector .
polytopeAdjacent. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every pair of natural numbers , every rational linear-program datum with , , and , and every , polytope adjacency means , both and are vertices, and for every , if , all , and for every the two equalities and imply , then there exists a rational with and for every . Here a vector is a vertex exactly when , all , and for every feasible rational , the coordinatewise equality implies and ; feasible means , for all , and similarly for . No positivity of or is assumed; when there cannot be distinct .
realizesCube. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For and a policy , put , , and for every . This is the basic point of the row-to-column function: repeated selected columns, if any, contribute by summation. The inverse is total, and these formulas alone impose no feasibility or determinant condition. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row . For every and every supplied proof of , cube realization is the conjunction of four requirements. First, there exists such that every rational satisfying and for all also satisfies for every ; no sign condition on is separately imposed. Second, for every policy , is a vertex. Third, for every rational vector that is a vertex, there exists exactly one policy with . Fourth, for every pair of policies , their differing in exactly one coordinate is equivalent to the polytope adjacency of and . In these clauses, a vertex is a feasible rational vector such that every feasible rational with for all satisfy and . Polytope adjacency of means that they are distinct vertices and every feasible rational with whenever has the form for all , for some rational with . All feasibility in this paragraph means and coordinatewise nonnegativity.
cubeStep. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row . The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For and a policy , put , , and for every . This is the basic point of the row-to-column function: repeated selected columns, if any, contribute by summation. The inverse is total, and these formulas alone impose no feasibility or determinant condition. For every , every supplied proof of , every rational vector , and every two policies , the directed relation holds exactly when they are cube-adjacent and . The basic points in this comparison are formed from with its original matrix and right-hand side; only the objective coefficients in the sums are replaced by . The comparison is strict, so equality of the two sums gives no directed edge in either direction. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every , every supplied proof of , every rational objective vector , and every pair of MDP states and , a cube step holds exactly when there exists such that , and for every with one has , and and . For each row , is the policy obtained by negating and keeping every other coordinate unchanged. The comparison of distances is non-strict, and this step predicate does not itself assume the AUSO predicate.
cubeRun. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , a policy is any function . No additional conditions are imposed. For or , there is exactly one such function, the empty function. For every , the number of columns is ; write for its finite index set. Thus . For every , an MDP state is a pair consisting of an arbitrary policy and an index . No further fields or constraints are imposed. There are no such states when or , because is empty. For every and policies , cube adjacency means that there exists with and, for every with , . Thus it requires exactly one differing coordinate. If or , no policies satisfy this relation, because there is no row . The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every name , every kind , every level , and every Boolean , the rational number is if and is otherwise. For every , define the rational number , with regarded as a rational number in this formula. In particular, is never zero. For every , define the rational number . For every , every pair , and every name , let , , and . The rational coefficient is defined by these cases: for and , it is ; for and , it is ; for , it is ; for and , it is , including the term ; for and , it is ; for , it is ; for and , it is ; and for and , it is . The pair and name need not correspond to indices of the program. For every pair , define the rational reward . In particular, because its exponent is zero. For every pair , define the rational reward . In particular, . For every and every name , define its rational objective coefficient as a base contribution plus . The base contribution is when and ; it is when and ; it is when ; and it is in every remaining case. In the subscripts of , denote kinds, whereas the last coordinate of the name is the Boolean . This defines a coefficient even for names outside all valid column ranges. For every , define the rational linear-program data with rows and columns by , , and . The underlying linear-program type stores only a rational matrix, right-hand-side vector, and objective vector; it does not impose feasibility, rank, boundedness, or sign conditions. Its rational feasible points are the vectors with and for every , and its objective at is . For or , both index sets are empty. For every and every name , define its natural-number rank as follows: if , and otherwise; ; ; ; ; ; ; ; ; and . The function is defined on every name, including levels outside the row or column ranges, and its output is a natural number, without a bound by . For every , every supplied proof of , every row , and every Boolean , the column for this action is , where . The positive column count makes this a member of . For every , every supplied proof of , and every policy , define the row-to-column function for every . Calling this function a basis imposes no injectivity, determinant, or feasibility condition. For and a policy , put , , and for every . This is the basic point of the row-to-column function: repeated selected columns, if any, contribute by summation. The inverse is total, and these formulas alone impose no feasibility or determinant condition. For every , every supplied proof of , every rational vector , and every two policies , the directed relation holds exactly when they are cube-adjacent and . The basic points in this comparison are formed from with its original matrix and right-hand side; only the objective coefficients in the sums are replaced by . The comparison is strict, so equality of the two sums gives no directed edge in either direction. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every , every supplied proof of , every rational objective vector , and every pair of MDP states and , a cube step holds exactly when there exists such that , and for every with one has , and and . For each row , is the policy obtained by negating and keeping every other coordinate unchanged. The comparison of distances is non-strict, and this step predicate does not itself assume the AUSO predicate. For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial policy is for each ; equivalently it selects exactly on rows of kind and on the row of kind and level , and selects on all other rows. This is the empty function if or . For every and every supplied proof of , the initial MDP state is , with . For every , every supplied proof of , every rational objective vector , every sequence , and every natural , a cube run holds exactly when , for every natural there is a cube step from to , and for every policy there is no edge from the policy of to under . This predicate permits when the initial policy already has no outgoing edge, and imposes no condition on for . It does not itself assert that the orientation is an AUSO.
vertices. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including .
vertexCode. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count.
sinkVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is .
sVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated vertex is .
fVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder.
gVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder.
hVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder.
decisionVertex. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case.
actionSource. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of columns is ; write for its finite index set. Thus . For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every and column , if then its source is . The Boolean component does not affect this source.
actionTarget. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero.
gameSuccessors. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and vertex , regarding as its natural index, the finite successor set is given by these ordered cases. If , write and use . Otherwise, if , put ; if use , and otherwise use . Otherwise, if , use . Otherwise, if , use . Otherwise, if , use . In every remaining case use . These are finite sets, so any duplicate entries are identified.
gamePriority. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated vertex is . For every and vertex , regarded as its natural index, define the natural priority by these ordered cases: if , use for row kinds in and use for row kinds ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; and in every remaining case use . No distinctness condition on these priority values is part of this definition.
parityGame. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and vertex , regarding as its natural index, the finite successor set is given by these ordered cases. If , write and use . Otherwise, if , put ; if use , and otherwise use . Otherwise, if , use . Otherwise, if , use . Otherwise, if , use . In every remaining case use . These are finite sets, so any duplicate entries are identified. For every and vertex , regarded as its natural index, define the natural priority by these ordered cases: if , use for row kinds in and use for row kinds ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; and in every remaining case use . No distinctness condition on these priority values is part of this definition. For every , define the finite game on by assigning owner to a vertex exactly when , and owner otherwise, assigning priority , and declaring an edge from to exactly when . The game data consist only of the owner function, natural priority function, and edge relation; no further game property is a field.
initialStrategy. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every , the number of rows is ; write for its finite index set. Thus . For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial strategy is a total function : for , write and put ; for every other , put . The definition does not restrict its input to vertices of one owner.
ParityState. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the number of columns is ; write for its finite index set. Thus . For every , a parity state is a pair with an arbitrary function and a last-column index . No legality condition is a field. There are no such states for or , because the last-column set is empty.
initialParityState. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the number of columns is ; write for its finite index set. Thus . For every , a parity state is a pair with an arbitrary function and a last-column index . No legality condition is a field. There are no such states for or , because the last-column set is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial strategy is a total function : for , write and put ; for every other , put . The definition does not restrict its input to vertices of one owner. For every and every supplied proof of , the initial parity state is , with .
parityStep. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the number of columns is ; write for its finite index set. Thus . For every , a parity state is a pair with an arbitrary function and a last-column index . No legality condition is a field. There are no such states for or , because the last-column set is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every and column , if then its source is . The Boolean component does not affect this source. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and vertex , regarding as its natural index, the finite successor set is given by these ordered cases. If , write and use . Otherwise, if , put ; if use , and otherwise use . Otherwise, if , use . Otherwise, if , use . Otherwise, if , use . In every remaining case use . These are finite sets, so any duplicate entries are identified. For every and vertex , regarded as its natural index, define the natural priority by these ordered cases: if , use for row kinds in and use for row kinds ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; and in every remaining case use . No distinctness condition on these priority values is part of this definition. For every , define the finite game on by assigning owner to a vertex exactly when , and owner otherwise, assigning priority , and declaring an edge from to exactly when . The game data consist only of the owner function, natural priority function, and edge relation; no further game property is a field. For this game and any total functions , call legal for owner if for every vertex with owner ; values at owner- vertices are unrestricted. Starting at any , form the infinite play and when has owner , or when it has owner . Let be the set of vertices visited arbitrarily late: means that for every natural there is with . Let be the supremum of the priorities of vertices in , with supremum for the empty set. Choose a vertex with priority if one exists, and otherwise choose the starting vertex . Let be the least natural index with if such an index exists, and use otherwise. The play valuation is the triple , where is a finite set of vertices, not a list of visits. For a finite vertex set and a natural priority , let . Define when there exists with , with for every natural , and with either even and , or odd and . Define count equivalence by for every natural . Put as an integer if is even and if it is odd. For valuations and , write exactly when , or and , or , , and either odd with or even with . Write to mean . A minimum valuation for the function at a starting vertex is a valuation that is the play valuation from for at least one legal owner- function and satisfies for the play valuation of every legal owner- function . Define by choosing such a minimum if any exists and using if none exists. There is no separate legality hypothesis on in these valuation definitions. Finally, a pair is improving for precisely when has owner , , and ; the strategy is improvable precisely when at least one such pair of vertices exists. For every and every two parity states and , a parity step holds precisely when there exists a column such that is improving for , for every column whose corresponding pair is improving one has , the function sends to and agrees with at every other vertex, and . The minimum-distance condition is non-strict. No hypothesis and no legality condition on either state is included in this step predicate; when or no parity states exist.
parityRun. All indices and parameters described as natural numbers include zero. In the formulas below, denotes subtraction in the natural numbers, denotes natural-number division, and denotes natural-number remainder. Boolean values are written for false and for true, and denotes their negation. A finite index set of size zero is empty. A rational matrix inverse is the total matrix inverse, which is the zero matrix when its determinant is zero; no nonzero-determinant condition is implicit in the notation. For every , the number of rows is ; write for its finite index set. Thus . For every , the vertex count is ; write for the vertex index set. Thus for every , including . For every , the number of columns is ; write for its finite index set. Thus . For every , a parity state is a pair with an arbitrary function and a last-column index . No legality condition is a field. There are no such states for or , because the last-column set is empty. The type consists of exactly five distinct constructors, denoted , with decidable equality. A name is a triple with kind , level , and Boolean value . There are no restrictions on the level or on combinations of fields. Equality of names is decidable. For every and column index , define the name by the following ordered cases. If , use . Otherwise, if , put and use respectively , , , or according as is , , , or anything else. Otherwise, if , put and use , where exactly when . Otherwise, if , use . Otherwise, if , use . In the last case put and use , where exactly when . There are no column indices when or . For every , the vertex code is , interpreted as an element of . Every natural code is permitted and is reduced modulo the positive vertex count. For every , the designated sink vertex is . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and pair , define the natural-number row rank by , , , , and . The input may have any level; the result has no imposed bound by the row count. For every , every kind , and every level , define by the following ordered cases: if and , use ; otherwise, if and , use ; otherwise use . Thus arbitrary levels are allowed, with truncated subtraction and remainder in the last case. For every and column , if then its source is . The Boolean component does not affect this source. For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every , the designated vertex is . For every and every name , its target is when and ; when ; when and ; when ; when and ; and when . The definition is total for all names, including level zero. For every , the ordering equivalence on is the identity , including the empty equivalence when or . For last-column index and candidate column , the cyclic distance used here is . It is the specialization of the formula to the identity ordering . Subtraction in the numerator is natural-number subtraction; it does not truncate for these indices because . In particular whenever such an index exists. For every and row index , define its kind and level by the following ordered cases: if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise, if , it is ; otherwise it is . There are no row indices when or . For every , define . In particular, and give the same value, and levels larger than are still defined by the same remainder. For every and vertex , regarding as its natural index, the finite successor set is given by these ordered cases. If , write and use . Otherwise, if , put ; if use , and otherwise use . Otherwise, if , use . Otherwise, if , use . Otherwise, if , use . In every remaining case use . These are finite sets, so any duplicate entries are identified. For every and vertex , regarded as its natural index, define the natural priority by these ordered cases: if , use for row kinds in and use for row kinds ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; otherwise, if , use ; and in every remaining case use . No distinctness condition on these priority values is part of this definition. For every , define the finite game on by assigning owner to a vertex exactly when , and owner otherwise, assigning priority , and declaring an edge from to exactly when . The game data consist only of the owner function, natural priority function, and edge relation; no further game property is a field. For this game and any total functions , call legal for owner if for every vertex with owner ; values at owner- vertices are unrestricted. Starting at any , form the infinite play and when has owner , or when it has owner . Let be the set of vertices visited arbitrarily late: means that for every natural there is with . Let be the supremum of the priorities of vertices in , with supremum for the empty set. Choose a vertex with priority if one exists, and otherwise choose the starting vertex . Let be the least natural index with if such an index exists, and use otherwise. The play valuation is the triple , where is a finite set of vertices, not a list of visits. For a finite vertex set and a natural priority , let . Define when there exists with , with for every natural , and with either even and , or odd and . Define count equivalence by for every natural . Put as an integer if is even and if it is odd. For valuations and , write exactly when , or and , or , , and either odd with or even with . Write to mean . A minimum valuation for the function at a starting vertex is a valuation that is the play valuation from for at least one legal owner- function and satisfies for the play valuation of every legal owner- function . Define by choosing such a minimum if any exists and using if none exists. There is no separate legality hypothesis on in these valuation definitions. Finally, a pair is improving for precisely when has owner , , and ; the strategy is improvable precisely when at least one such pair of vertices exists. For every and every two parity states and , a parity step holds precisely when there exists a column such that is improving for , for every column whose corresponding pair is improving one has , the function sends to and agrees with at every other vertex, and . The minimum-distance condition is non-strict. No hypothesis and no legality condition on either state is included in this step predicate; when or no parity states exist. For every pair , define the Boolean to be exactly when or both and , and to be otherwise. For every , the initial strategy is a total function : for , write and put ; for every other , put . The definition does not restrict its input to vertices of one owner. For every and every supplied proof of , the initial parity state is , with . For every , every supplied proof of , every sequence , and every natural , a parity run holds exactly when , for every natural the strategy in satisfies for every owner- vertex , for every natural there is a parity step from to , and the strategy in has no improving pair among any vertices of . The final condition quantifies over all vertex pairs, not just column labels. The definition permits if the initial strategy is legal for owner and has no improving pair; it imposes no condition on for .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.