AFTD Auto-Formalizing Theoretical Domains

pyranim_fin_lookup

def

For l : Fin m → Fin (m+2), pyranim_fin_lookup m l j is the ℕ-th value of l when j < m, and the default m+2 otherwise, so that sequences can be indexed by natural numbers.

Statement

def pyranim_fin_lookup (m : ℕ) (l : Fin m → Fin (m + 2)) (j : ℕ) : ℕ
Source
step towards pyranim_card_stable_positions
Verified
13 Nov 2026
Axioms
none listed
Used by 2
  • pyranim_seq_idealFor a sequence l : Fin n → Fin (n+2), pyranim_seq_ideal n l is the set of chips (a,b) of the n-tier pyramid with l(b-1) ≤ a: each column b…
  • pyranim_seq_first_emptypyranim_seq_first_empty n l is the least j with 0 < j < n+1 and l(j) = j+2, that is the first column after the first one that is empty; it…

Lean source view module on GitHub

/-- Total ℕ-indexed lookup into a Fin-indexed sequence, with default value m+2. -/
def pyranim_fin_lookup (m : ℕ) (l : Fin m → Fin (m + 2)) (j : ℕ) : ℕ := if h : j < m then (l ⟨j, h⟩ : ℕ) else m + 2
See it in the graphDiscuss this resultChallenge it