AFTD Auto-Formalizing Theoretical Domains

Cslib.URM.Steps.preserves_register

theoremverifiedformalizationimported Lean

Multi-step execution preserves registers not written by any executed instruction.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable (p : Program) in
variable {p : Program} in
theorem Cslib.URM.Steps.preserves_register {s s' : State} {r : ℕ}
    (hsteps : Steps p s s')
    (hr : ∀ instr, instr ∈ p → instr.writesTo ≠ some r) :
    s'.regs.read r = s.regs.read r
Formalizes
CSLib, `Cslib.URM.Steps.preserves_register`
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
Classical.choiceQuot.soundpropext
Built on 11

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true invariable (p : Program) invariable {p : Program} in/-- Multi-step execution preserves registers not written by any executed instruction. -/theorem Cslib.URM.Steps.preserves_register {s s' : State} {r : ℕ}    (hsteps : Steps p s s')    (hr : ∀ instr, instr ∈ p → instr.writesTo ≠ some r) :    s'.regs.read r = s.regs.read r := by  induction hsteps using Relation.ReflTransGen.head_induction_on with  | refl => rfl  | head hstep => grind [Step.preserves_register hstep (r := r)]
See it in the graphDiscuss this resultChallenge it