AFTD Auto-Formalizing Theoretical Domains

Cslib.URM.Computes

defimported Lean

A program p computes a partial function f : (Fin n → ℕ) → Part ℕ if for any input, eval p inputs = f inputs as partial values. This captures both: - The program halts iff the function is defined on that input - When both are defined, the program's output equals the function's value Note: Inputs are provided in registers 0, 1, ..., n-1 and output is read from register 0.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
def Cslib.URM.Computes (n : ℕ) (p : Program) (f : (Fin n → ℕ) → Part ℕ) : Prop
Defined in
CSLib, `Cslib.URM.Computes`
Lean proof
By Jesse Alama, from github.com/leanprover/cslib at 3951377e5a3f (Copyright (c) 2026 Jesse Alama. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.
Verified
08 Oct 2026
Axioms
none listed
Built on 6
Used by 1
  • Cslib.URM.ComputableA partial function f : (Fin n → ℕ) → Part ℕ is URM-computable if there exists a URM program that computes it.

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
/-- A program `p` computes a partial function `f : (Fin n → ℕ) → Part ℕ` if for any input, `eval p inputs = f inputs` as partial values. This captures both: - The program halts iff the function is defined on that input - When both are defined, the program's output equals the function's value Note: Inputs are provided in registers 0, 1, ..., n-1 and output is read from register 0. -/
def Cslib.URM.Computes (n : ℕ) (p : Program) (f : (Fin n → ℕ) → Part ℕ) : Prop :=
  ∀ inputs : Fin n → ℕ, eval p (List.ofFn inputs) = f inputs
See it in the graphDiscuss this resultChallenge it