All proofs
Project-declaredLean 4.33.0-rc1 · mathlib@169c26b52a38

Straight line halts from regs

Cslib.URM.straight_line_halts_from_regs

Plain-language statement

Straight-line programs halt from any starting registers, not just State.init. Useful for chaining: after running one program, we can run the next straight-line segment from whatever registers we're in.

Exact Lean statement

theorem straight_line_halts_from_regs {p : Program} (hsl : p.IsStraightLine) (r : Regs) :
    ∃ s, Steps p ⟨0, r⟩ s ∧ s.isHalted p ∧ s.pc = p.length

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem straight_line_halts_from_regs {p : Program} (hsl : p.IsStraightLine) (r : Regs) :     s, Steps p 0, r s  s.isHalted p  s.pc = p.length := by  suffices h :  s : State, s.pc  p.length   s', Steps p s s'  s'.pc = p.length by    obtain s', hsteps, hpc' := h 0, r (Nat.zero_le _)    exact s', hsteps, Nat.le_of_eq hpc'.symm, hpc'  intro s hpc_le  generalize hrem : p.length - s.pc = remaining  induction remaining using Nat.strong_induction_on generalizing s with  | h n ih =>  by_cases hhalted : s.pc  p.length  · grind  · have jmp : ¬p[s.pc].IsJump := by apply hsl; grind    have := Step.of_nonJump (by lia) jmp    grind [Relation.ReflTransGen.head]
Project
Lean Computer Science Library
License
Apache-2.0
Commit
f36649cff2c9
Source
Cslib/Computability/URM/StraightLine.lean:83-96

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

Project-declaredLean 4.33.0-rc1

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.

computer sciencecomputabilityprogram semantics

Source project: Lean Computer Science Library

Person-level attribution pending.

View proof record
Project-declaredLean 4.33.0-rc1

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.

computer sciencecomputabilityprogram semantics

Source project: Lean Computer Science Library

Person-level attribution pending.

View proof record