Is Halted iff normal
Cslib.URM.isHalted_iff_normal
Plain-language statement
A state is halted iff it is normal (has no successor) in the reduction system.
Exact Lean statement
theorem isHalted_iff_normal {p : Program} {s : State} :
s.isHalted p ↔ Relation.Normal (Step p) sFormal artifact
Lean source
theorem isHalted_iff_normal {p : Program} {s : State} : s.isHalted p ↔ Relation.Normal (Step p) s := by constructor · intro hhalted ⟨s', hstep⟩ exact Step.no_step_of_halted hhalted hstep · intro hnormal -- If not halted, then p[s.pc]? = some instr for some instruction by_contra hnothalted simp only [State.isHalted, not_le] at hnothalted have hlt : s.pc < p.length := hnothalted have hinstr : p[s.pc]? = some p[s.pc] := List.getElem?_eq_getElem hlt -- Any instruction can step, contradicting hnormal cases hp : p[s.pc] with | Z n => exact hnormal ⟨_, Step.zero (hp ▸ hinstr)⟩ | S n => exact hnormal ⟨_, Step.succ (hp ▸ hinstr)⟩ | T m n => exact hnormal ⟨_, Step.transfer (hp ▸ hinstr)⟩ | J m n q => by_cases heq : s.regs.read m = s.regs.read n · exact hnormal ⟨_, Step.jump_eq (hp ▸ hinstr) heq⟩ · exact hnormal ⟨_, Step.jump_ne (hp ▸ hinstr) heq⟩- Project
- Lean Computer Science Library
- License
- Apache-2.0
- Commit
- f36649cff2c9
- Source
- Cslib/Computability/URM/Execution.lean:113-132
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.