lean4-htt/tests/lean/run/9365.lean
Sebastian Graf 2d30e3913c
fix: Handle let/have in mintro (#9365) (#9451)
This PR adds support in the `mintro` tactic for introducing `let`/`have`
binders in stateful targets, akin to `intro`. This is useful when
specifications introduce such let bindings.

Closes #9365.
2025-07-22 11:35:46 +00:00

23 lines
594 B
Text

import Std.Tactic.Do
open Std.Do
set_option mvcgen.warning false
abbrev SM := StateM (Array Nat)
abbrev gns : SVal ((Array Nat)::[]) (Array Nat) := fun s => SVal.pure s
noncomputable def setZeroHead : StateM (Array Nat) Unit := do
modify fun _ => #[0, 1, 2, 3, 4, 5]
theorem setZeroHead_spec :
⦃⌜True⌝⦄
setZeroHead
⦃⇓ _ => ⌜∃ ns', (#gns).toList = 0 :: ns'⌝⦄ := by
mvcgen [setZeroHead]
-- We want `mintro`duce the tuple `t` here in order for us not having to repeat its
-- definition in t.2.toList.tail below
mintro t
simp
exists t.2.toList.tail