Halts With Result iff eval
Cslib.URM.haltsWithResult_iff_eval
Plain-language statement
A program halts with result a iff evaluation returns Part.some a.
Exact Lean statement
theorem haltsWithResult_iff_eval {inputs : List ℕ} {result : ℕ} :
p ↓ inputs ≫ result ↔ eval p inputs = Part.some resultFormal artifact
Lean source
theorem haltsWithResult_iff_eval {inputs : List ℕ} {result : ℕ} : p ↓ inputs ≫ result ↔ eval p inputs = Part.some result := by rw [Part.eq_some_iff, eval, Part.mem_map_iff] constructor · intro ⟨s, hsteps, hhalted, hresult⟩ have hhalts : Halts p inputs := ⟨s, hsteps, hhalted⟩ have heq : (evalState p inputs).get hhalts = s := Steps.eq_of_halts (evalState_spec p hhalts).1 (evalState_spec p hhalts).2 hsteps hhalted exact ⟨(evalState p inputs).get hhalts, Part.get_mem hhalts, heq ▸ hresult⟩ · intro ⟨s, hs_mem, hresult⟩ rw [Part.mem_eq] at hs_mem obtain ⟨hdom, hget⟩ := hs_mem have hspec := evalState_spec p hdom exact ⟨s, hget ▸ hspec.1, hget ▸ hspec.2, hresult⟩- Project
- Lean Computer Science Library
- License
- Apache-2.0
- Commit
- f36649cff2c9
- Source
- Cslib/Computability/URM/Execution.lean:238-251
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Unique minimal
Cslib.Automata.DA.FinAcc.unique_minimal
Plain-language statement
The minimal DFA M accepting the language l is unique up to unique isomorphism.
Source project: Lean Computer Science Library
Person-level attribution pending.
Buchi Family cover
Cslib.Automata.NA.Buchi.buchiFamily_cover
Project documentation
na.buchiFamily is a cover if na has only finitely many states. This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details of na.BuchiCongruence other than that it is of finite index.
Source project: Lean Computer Science Library
Person-level attribution pending.
Buchi Family saturation
Cslib.Automata.NA.Buchi.buchiFamily_saturation
Plain-language statement
na.buchiFamily saturates the ω-language accepted by na.
Source project: Lean Computer Science Library
Person-level attribution pending.