AFTD Auto-Formalizing Theoretical Domains

is_stationary_distribution

def

For a natural number n, a rational matrix P : Matrix (Fin n) (Fin n) ℚ, and a rational vector π : Fin n → ℚ, is_stationary_distribution P π asserts that Matrix.vecMul π P = π, each coordinate of π is nonnegative (0 ≤ π i for all i : Fin n), and the sum of π i over all i : Fin n equals 1.

Statement

def is_stationary_distribution {n : ℕ} (P : Matrix (Fin n) (Fin n) ℚ) (π : Fin n → ℚ) : Prop
Defined in
arXiv:2610.08949, Section 1
Verified
26 Oct 2026
Axioms
none listed

Read back from the Lean

For a natural number $n$, an $n \times n$ matrix $P$ with rational entries, and a vector $\pi : \text{Fin } n \to \mathbb{Q}$, is_stationary_distribution P π is the proposition that: 1. $\pi$ multiplied on the left of $P$ equals $\pi$ (Matrix.vecMul π P = π), 2. for all $i \in \text{Fin } n$, $\pi(i) \ge 0$, and 3. the sum over all $i \in \text{Fin } n$ of $\pi(i)$ is equal to $1$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- A rational probability vector π is a stationary distribution for a rational matrix P if Matrix.vecMul π P = π. -/
def is_stationary_distribution {n : ℕ} (P : Matrix (Fin n) (Fin n) ℚ) (π : Fin n → ℚ) : Prop := Matrix.vecMul π P = π ∧ (∀ i, 0 ≤ π i) ∧ (∑ i, π i) = 1
See it in the graphDiscuss this resultChallenge it