Cslib.URM.State.instInhabited
instanceimported Lean
Cslib.URM.State.instInhabited
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in instance Cslib.URM.State.instInhabited : Inhabited State
- Defined in
- CSLib, `Cslib.URM.State.instInhabited`
- 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.Cslib.URM.State.instInhabited← @Cslib/Computability/URM/Defs.lean:180 (Cslib/Computability/URM/Defs.lean:180): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 3
- Cslib.URM.State.instDecidableIsHaltedCslib.URM.State.instDecidableIsHalted
- Cslib.URM.State.initInitial state for a program with given inputs. The program counter starts at 0, and inputs are loaded into registers 0, 1, ....
- Cslib.URM.StateMachine state: program counter (0-indexed) and register contents.
- Used by 33
- Cslib.URM.Step.deterministicThe step relation is deterministic: each state has at most one successor.
- Cslib.URM.State.isHalted_iffCslib.URM.State.isHalted_iff
- Cslib.URM.Step.no_step_of_haltedA halted state has no successor in the step relation.
- Cslib.URM.evalEvaluation as a partial function using
Part. Defined when the program halts, returning the value in register 0. - Cslib.URM.StepsMulti-step execution: the reflexive-transitive closure of
Step. - Cslib.URM.evalStateEvaluation returning the full halting state.
- Cslib.URM.DivergesA program diverges on given inputs if it does not halt.
- Cslib.URM.ProgramEquivTwo programs are equivalent if they produce the same result for all inputs.
- Cslib.URM.State.extExtensionality for State: two states are equal iff their components are equal.
- Cslib.URM.HaltsWithResult.toHaltsIf a program halts with a result, it halts.
- Cslib.URM.HaltsA program halts on given inputs if execution reaches a halted state. This is equivalent to
(Step p).Normalizable (State.init inputs)—… - Cslib.URM.straightLineFinalRegsThe final registers after running a straight-line program from given starting registers.
- Cslib.URM.straight_line_halts_from_regsStraight-line programs halt from any starting registers, not just State.init. Useful for chaining: after running one program, we can run…
- Cslib.URM.HaltsWithResultA program halts on given inputs with a specific result in R[0].
- Cslib.URM.Step.of_nonJumpA non-jumping instruction produces a step that increments PC by 1.
- Cslib.URM.ComputesA program
pcomputes a partial functionf : (Fin n → ℕ) → Part ℕif for any input,eval p inputs = f inputsas partial values. This… - Cslib.URM.Step.toStandardFormForward step correspondence: if p steps from s to s', then either: (1) p.toStandardForm steps from s to s' (same step), or (2) s' is…
- Cslib.URM.isHalted_iff_normalA state is halted iff it is normal (has no successor) in the reduction system.
- Cslib.URM.instSetoidProgramSetoid instance for programs, enabling the ≈ notation.
- Cslib.URM.Step.from_toStandardFormReverse step correspondence: if p.toStandardForm steps from s to s', then either: (1) p steps from s to s' (same step), or (2) s' is…
- Cslib.URM.Step.preserves_registerA single step preserves registers not written to by the current instruction. This is a fundamental property of URM execution: each…
- Cslib.URM.evalState_specSpecification: the state from evalState satisfies Steps and isHalted.
- Cslib.URM.ComputableA partial function
f : (Fin n → ℕ) → Part ℕis URM-computable if there exists a URM program that computes it. - Cslib.URM.straight_line_state_at_pcIn a straight-line program, we can characterize the state at any intermediate pc. This gives us the state after executing instructions…
- Cslib.URM.State.instReprCslib.URM.State.instRepr
- Cslib.URM.ProgramEquiv.equivalenceProgram equivalence is an equivalence relation.
- Cslib.URM.straightLinefinalState_specSpecification: the state from straightLinefinalState satisfies Steps, isHalted, and has pc = p.length.
- Cslib.URM.StepSingle-step execution relation for URMs. Each constructor corresponds to one of the four instruction types: -
zero: ExecuteZ n(set… - Cslib.URM.Steps.preserves_registerMulti-step execution preserves registers not written by any executed instruction.
- Cslib.URM.Halts.toHaltsWithResultIf a program halts, it halts with the output of the final state.
- Cslib.URM.straight_line_haltsA straight-line program halts on any input.
- Cslib.URM.halts_iff_normalizableHalting is equivalent to normalizability in the reduction system.
- Cslib.URM.straightLinefinalStateThe halting state for a straight-line program starting from registers r. Wraps Classical.choose to hide it from the API.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in instance Cslib.URM.State.instInhabited : Inhabited State := ⟨init []⟩