AFTD Auto-Formalizing Theoretical Domains

hunger_step

def

For n : ℕ with [NeZero n], a type K with a linear order, additive group structure, and one, a matrix P : Matrix (Fin n) (Fin n) K, and a vector h : Fin n → K, hunger_step P h is the vector sending each j : Fin n to h j + P (hunger_firing_state h) j - (if j = hunger_firing_state h then 1 else 0).

Statement

def hunger_step {n : ℕ} [NeZero n] {K : Type*} [LinearOrder K] [AddGroup K] [One K] (P : Matrix (Fin n) (Fin n) K) (h : Fin n → K) : Fin n → K
Defined in
arXiv:2610.08949 Eq (2.1)
Verified
26 Oct 2026
Axioms
none listed
Built on 1
  • hunger_firing_stateGiven a positive natural number n, a linearly ordered type α, and a vector h : Fin n → α, hunger_firing_state h is the smallest index i :…
Used by 3
  • hunger_iterFor n : ℕ with [NeZero n], a linearly ordered additive group K with one, a matrix P : Matrix (Fin n) (Fin n) K, a natural number t, and an…
  • real_hunger_coalescence_persistsFor any positive natural number n, any n-by-n real matrix P, and any vectors h1, h2 : Fin n → ℝ, if the hunger trajectories from h1 and h2…
  • hunger3_firing_cellFor a real 3-by-3 matrix Q and a permutation e, hunger3_firing_cell Q e is the topological closure (in Fin 3 → ℝ) of the set of zero-sum…

Read back from the Lean

Given a positive natural number n ([NeZero n]), a type K equipped with a linear order ([LinearOrder K]), an additive group structure ([AddGroup K]), and an element 1 ([One K]), a matrix P : Matrix (Fin n) (Fin n) K, and a state vector h : Fin n → K, hunger_step P h is the state vector Fin n → K mapping each j : Fin n to h j + P i j - (if j = i then 1 else 0), where i : Fin n is the firing state hunger_firing_state h (the index in List.finRange n maximizing h, chosen by List.argmax).

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

/-- One step of the hunger game dynamics given a transition matrix P. -/
def hunger_step {n : ℕ} [NeZero n] {K : Type*} [LinearOrder K] [AddGroup K] [One K] (P : Matrix (Fin n) (Fin n) K) (h : Fin n → K) : Fin n → K := let i := hunger_firing_state h; fun j => h j + P i j - (if j = i then 1 else 0)
See it in the graphDiscuss this resultChallenge it